The Linux Page

Page list for MS-Windows

  • Today I decided to write a document for a customer about some work I have done for them.

    I thought it would be a good idea to use Microsoft Word on the system I'm using for the development. It is from Office 2007.

    Not too surprised that things look all different since I used MS-Access for a while now and it has this same new "weird" look.

    What I ran into, however, is a wall when it came to creating styles with nested lists. You know, a usual document with points:

    1.
    1.1
    1.2
    1.2.1
    1.2.2
    2.
    2.1
    2.2
    etc.

    And I could create lists, but not nested lists. In other ...

  • As I was trying to debug a problem using an STL vector, I looked at the resulting assembly and saw this strange thing:

    mov eax,dword ptr fs:[0000000h]

    And a little further down, the opposite:

    mov dword ptr fs:[0000000h],eax

    These statements are from VC++ so the first is "put fs:[0] in eax" and the second is "save eax at fs:[0]".

    Curious I looked around and found a page describing what's really hapenning. If you need to know, that's actually initializing the exception structure for this function. The fs:[0] location is where that structure pointer is saved ...

  • MS-Access can be programmed with VBA which is neat. I do that a lot because the default forms do not allow you to strongly verify the data validity or even better: prevent you from editing certain record because they are too old, you don't have permissions, it was already archived in some way (i.e. invoice paid), etc.

    However, I often encounter problems with the focus. The main thing I do to make it as safe as possible is show or hide buttons. If you cannot activate function A, then there is no point in having a button for function A. Instead, we should hide the function A button when we ...

  • Problem

    As I'm working with MS-Access, I'm learning all sorts of things.

    I had to write my own SQL because the database management was such that a simple form just did not fit well (i.e. things like multiple unique keys to be checked between MS-Access and a QuickBooks database...)

    The SQL is relatively easy to write (there are a few tricks with MS-Access, for instance, dates are written between hash characters: #2009/01/01 00:00:01# and you cannot use all balls or it fails!)

    Now, I tried to use the same form to:

  • In VB and MS-Access, whenever a variable referencing an object is set to Nothing, you cannot access any field since the variable does not actually point to a physical object.

    This, code like this breaks:

    	Dim r Is Object 
    	r = Nothing 
    	...
    	r.Field = 5  ' Breaks if r is still Nothing
    

    Thus, you need to test whether the variable r is defined.

  • Today I got this weird error: Application-defined or object defined error.

    Looking into it, I could not find the right answer.

    The failing code was in a sub-form and when called it generated the error immediately. The code I wrote was:

    Parent.NewSelection

    And of course, in the parent I had the NewSelection function defined:

    Private Sub NewSelection
        DoSomething
    End Sub

    The DoSomething would update a button as required...

    For real MS-Access pros, you may already have noticed what the problem was. What's really annoying is that the error we get is not capable of telling ...

  • As most people know, all of the MS-Office macros are written in Visual Basic.

    Visual Basic is for sure a huge whole lot better than the BASIC I had on my Apple //c. For one thing, it does not require line numbers and you can declare functions, procedures, and have local variables (FOR loops that use the variable I do not overwrite the variable I of the FOR loop from the calling function!)

    Since MS-Access 2007, we have the possibility to create classes!

  • To define a constant in MS-Access, use the Const keyword as in:

    Private Const varname = "Some value"
    

    The value can be a string, integer, floating point. The variable can be made public in which case it is global among all modules and forms.

    The value after the equal sign must be constant at time of compilation which is why it is limited to strings, integers and floating point values.

  • Today I experienced a hard lock-up with MS-Access as I was in a form typing a new query.

    The new query data is checked first, if valid, then the query is processed and ends in a SELECT SQL order which I save in the Form with a simple OpenRecordset call as in:

    sql = "SELECT stuff FROM thing WHERE foo LIKE 'begin*'"
    Set CUSTOMER_LIST.Form.Recordset = CurrentDb.OpenRecordset(sql)

    That used to work just fine in older versions of MS-Access, but we now use MS-Access 2007.

    The hanging happens on the 2nd line, when the Set occurs. Note that it generally happens the second

  • Today I was creating a report and created a table with a column named 'Group'. It looked like it worked just fine so I moved on with it.

    Then, at the point I wanted to insert data with a simple INSERT INTO ... statement, it broke. The statement would generate a syntax error. Yes. The simple answer is that GROUP is viewed as a keyword and thus when used as a field name it needs to be escaped (i.e. written between backward quotes: `...`). Not liking the need to escape a field name each time I use it, I just renamed the field which is even better.

Syndicate content

SMS From Me Logo

SMS From Me

To automatically start one on one conversations with your online leads.

     

   

Terms of Site Index

Find the page/content you are looking for with our index.