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

What is wrong with this DLookup? 1

Status
Not open for further replies.

ancb

Programmer
Aug 7, 2003
42
0
0
US
I am trying to use a DLookup to fill in a text box"

MTMiles.Value = DLookup("[DHMiles]", "taRate", "[ShipID] = Forms![sfLoadPlanning]![CurrentLocID]" And "[RecID] = Forms![sfLoadPlanning]![Shipper]")

When it is executed I get a 'Type Mismatch!' Error.
What am I missing.

Thanks in advance,

ancb
 
Hi!

Try

[tt]DLookup("[DHMiles]", "taRate", "[ShipID] = " & _
Forms![sfLoadPlanning]![CurrentLocID] & " And [RecID] = " & _
Forms![sfLoadPlanning]![Shipper])[/tt]

- if both fields are numeric and the form in question is open

Roy-Vidar
 
Thanks RoyVidar,

The &s did the trick.

Here's a star.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top