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

dlookup with subforms

Status
Not open for further replies.

sillysender

Programmer
Joined
May 5, 2008
Messages
1
this code works as customer software is the main form
Me![SOFTVER] = DLookup("[VERSION]", "[SOFTWARELINK]", "[DWG#] =" & """" & Forms![CUSTOMER SOFTWARE]![EECPARTNO] & """")

but not with it being a subform

I tried using this, but it doesn't work
Me![SOFT] = DLookup("[TYPE]", "[SOFTWARELINK]", "[DWG#] = " & """" & [Forms]![JOB NUMBER]![CUSTOMER SOFTWARE].[Form]![EECPARTNO] & """")

This coding works with another database but won't work in the one I am currently using
'Me![Description] = DLookup("[Description]", "[Products]", "[Part Number ID] = Forms![Proposed Products Menu]![Proposed Products].Form![Part Number ID]")

 
What does not work? Get an error? Wrong value? Error Message?

Debug it in pieces:

debug. print [Forms]![JOB NUMBER]![CUSTOMER SOFTWARE].[Form]![EECPARTNO]

See if that give you the correct EECPARTNO

debug.print "[DWG#] = " & """" & [Forms]![JOB NUMBER]![CUSTOMER SOFTWARE].[Form]![EECPARTNO] & """"

See if that gives you the correct string. One thing I noticed you return [Version] in the first case and [Type] in the second. I doubt that is correct.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top