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 format question 1

Status
Not open for further replies.

ProtegeV2

Technical User
Sep 9, 2004
40
CA
I am trying to display a calculation in a form - here is the On Current I have so far:

Private Sub Form_Current()

[txtDocInv] = DLookup("[InvoicedToDate]", "[qryInvoicedTD]", _
" & [Docket #])

End Sub

[InvoicedToDate] is a calculation in a separate query (not connected to the form)

[Docket #] is a form field - when a record is displayed I want it to display the corresponding calculation from [InvoicedToDate].

Can you tell me what I am missing? Thank you.
 
You need to specify which form to look for your form variables and your criteria must be in the form of an SQL WHERE clause.

Assuming your unique field in your qry is [InvoiceID]

Code:
Private Sub Form_Current()

[b]me![/b][txtDocInv] = DLookup("[InvoicedToDate]", "[qryInvoicedTD]", [b]"[InvoiceID]=" & me![Docket #][/b])
    
End Sub

HTH

----------------------------
SnaveBelac - Adventurer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top