Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can some one debug this Dlookup code?

Status
Not open for further replies.

osx99

Technical User
Apr 9, 2003
250
GB
I have a form with an option box [EarthPrev] to select different repair types which populate control [repair type] on table [Structures Input]

I have another table named [REPAIR TYPE] which has a description of the repair types with the repair type ID with fields [repair no] and [measure dimension] ([repair type] being primary key and unique)

I am trying unsuccessfully to use the following code to update [measure dimension] in [Structures input] with the corresponding row from [REPAIR TYPE] after selecting the option box button

Me![Measure Dimension] = DLookup("[Measure Dimension]", "[Repair Type]", "[Repair Type] = Me![EarthPrev]")

Can anyone help with correct code for populating the field in my table by looking up the correct description in the row form a seperate unlinked table?

Thanx in advance
Os x
 
It might be as simple as surrounding your criteria value with SINGLE quotes - generally, if the criteria is a text guy, you need to do somthing like this:

...{rest of dlookup here}.."RepairType = '" & Me!EarthPrev & "'" )

This will resolve to something like this:

"repairtype = 'ABC'"

Note the single quotes embedded within the regular double-quoted criteria string as a whole.

Jim



Me? Ambivalent? Well, yes and no....
Another free Access forum:
More Access stuff at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top