Syndicate content

Page list for MS-Windows

  • 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.

  • When creating an unbound text in MS-Access it is not constrained in length. The text limit you get when the field is bound to the database table is really neat, but there is not direct way to access that code (it's probably something hard coded in the MS-Access system.)

    This means you have to re-implement the behavior.

    I found this page Unbound text box: limiting entry length which has a very good solution. Just in case the page disappears, there is what I use (a simplified version that doesn't manage errors because I do not like that — errors are not supposed to happen, when they do,

  • Problem

    One of my customers changed a report and all of a sudden was getting an empty page for every other page (it will look like the last page in case you print a single page, but it really is every other page.)

    Did you think about the margins?

    When you create a report to be printed, you must define its size properly. So if you are printing 8"1/2 x 11" paper, you want to create a report that's exactly (to about 1/100th) the same size.

    The total height must be 11" and the total width must be 8"1/2. However, the actual page that you create does NOT include the ...

Syndicate content

Diverse Realty

Diverse Realty Team

Want a New Home?
Want to Sell Your House?

Call Alex at
+1 (916)
220 6482

Alexis Wilke, Realtor
Salesperson
Lic. # 02024063

Cory Marcus, Broker
Lic. # 01079165

     

Terms of Site Index

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

  • VLC
  • certificate
  • combobox
  • not

    In programming there are two not operators. One is the logical not that transforms TRUE into FALSE and vice versa. The other transforms bits from 0 to 1 and vice versa. not is also used in documentation with a very specific meaning. Often, the accompagnying verb defines the meaning with more details (i.e. MUST NOT and SHOULD NOT.)

  • return