DLOOKUP ISSUE

P

Patrick Stubbin

I USE DLOOKUP ELSEWHERE IN THE DATABASE AND NO PROBLEM

Dim occ As String

occ = DLookup("Description", "Gal", "ID=" & Me.Name)
I USE THIS ON AN AFTER UPDATE POINT

WHY DOES THIS GIVE AN ERROR THAT SAYS THE ERROR IS THAT THE OBJECT OR CLASS
DOES NOT SUPPORT THE SET OF EVENTS OR TEHRE IS SOME SORT OF OTHER ERROR...
BOTH ID AND ME.NAME ARE LONG INTEGERS
 
D

Dirk Goldgar

Patrick Stubbin said:
I USE DLOOKUP ELSEWHERE IN THE DATABASE AND NO PROBLEM

Dim occ As String

occ = DLookup("Description", "Gal", "ID=" & Me.Name)
I USE THIS ON AN AFTER UPDATE POINT

WHY DOES THIS GIVE AN ERROR THAT SAYS THE ERROR IS THAT THE OBJECT OR
CLASS
DOES NOT SUPPORT THE SET OF EVENTS OR TEHRE IS SOME SORT OF OTHER
ERROR...
BOTH ID AND ME.NAME ARE LONG INTEGERS


Please don't post in all caps. It makes your messages hard to read and
often comes across as shouting.

It's unlikely that Me.Name is a long integer, as Me.Name (referred to in
code behind a form) will always return the name of the form, because Name is
a property of the form. If you have a field and/or control in on your form
named "Name" -- a very bad name for a field, as it can so easily lead to
problems like this -- then you must use:

Me!Name

instead of

Me.Name

That may not be the only problem with your form, but its certainly *a*
problem with the line of code you posted.
 
Top