Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2002
    Location
    Kansas City
    Posts
    103

    Unanswered: Incorrect syntax when referring to a table field in VBA

    I'm trying to evaluate a condition from a form but apparently do not have the correct VBA syntax. Specifically, I want to determine whether a particular field is null within a make table when the user clicks on a form command button. I.E.

    If "[Table Name].[Field]" <> "" Then..........

    At first, I was receiving "MS Access can't find the field "|" referred to in your expression - Run time error '2465'" I eliminated that error by switching from () to "" around the table name and field. Now the If then statement is ignored.

    Last edited by JamesB; 07-05-02 at 17:32.

  2. #2
    Join Date
    May 2002
    Location
    Atlanta, GA
    Posts
    117
    Hey James,

    I am assuming that your using a form. Right?

    If so try using the following:

    If IsNull(Me.SomeField) Then
    Do Something
    Elseif Me.Somefield = "" Then
    Do Something
    End if

    If this doesn't help try and be a little more specific.
    Kal

  3. #3
    Join Date
    Jun 2002
    Location
    Kansas City
    Posts
    103
    Thanks Kal - looks like my syntax may have been off.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •