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 not working 2

Status
Not open for further replies.

access345

Programmer
Nov 23, 2005
78
US
I have the following code which gives me a compile error Syntax error.

Private Sub txtRef_Desig_Enter()

=DLookup("[Part_Description]", "TblPartsList", "[txtRef_Desig]=Forms!frmInitialInspection![txtPart_Description]")
End Sub

My form Name is frmInitialInspection
The entry textbox on this form is txtRef_Desig
The display text box is named txtPart_Description

The Table the information is coming from is called TblPartsList

The field the information is based on is Ref_Designation

The field the information is based on is Part_Description.

Can someone help?
 
How about:

[tt]=DLookup("[Part_Description]", "TblPartsList", "[txtRef_Desig]='" & Forms!frmInitialInspection![txtPart_Description] & "'")[/tt]

I suspect txtRef_Desig is text, if it is not, drop the single quotes.
 
I am trying to make one of the fields in my form searchable:


My form Name is Transplants
The entry textbox on this form is MRN #
The display text box is named MRN #

The Table the information is coming from is called Transplants

The field the information is based on is MRN #

The field the information is based on is (Are you suppose to have two? if so how?

With this information how can I modify the following to work:

Private Sub MRN_Enter()

=DLookup("[Part_Description]", "TblPartsList", "[txtRef_Desig]='" & Forms!frmInitialInspection![txtPart_Description] & "'")


 
I can't quite see what you want to do. Have you looked at combo boxes? If you have a bound form, you can use the wizard to add a combo, selecting 'Find a record on my form ...' on the first window.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top