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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DLookUp Syntax Problem

Status
Not open for further replies.

dots

Technical User
Jul 13, 2001
24
US
Hi, I'm trying to use Dlookup in a form to find the closed date and time of the previous record. This is the syntax I'm using.

=DLookUp(" [MainTable]![PullDateTime] ","Main Table","[MainTable]![ChargeNo] = [LastCharge] ")

LastCharge is a hidden field that subtracts one from the current Charge Number (which is the record number).

I keep getting an error returned in that field. Can anyone tell me what is wrong with my syntax??

Thanks alot!
 

Try this.

=DLookUp("PullDateTime", "MainTable", "[ChargeNo]=" & Me.LastCharge)
Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Thanks Terry, but I must be doing something else wrong because it returns a value of #Name?. The field is formatted for a General Date, as it is in the table.

Any other ideas?
 
What is the name of the box where you are trying to display this?
 
Ooops! Finally figured out where I went wrong (after hours of frustration). I put a space between MainTable "Main Table".

Thanks for the help and sorry about that (boy,do I feel stupid!).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top