dlookup and 3464

A

acitarella

I have run the following "event procedure" from a combo box and am
getting a "data type mismatch error: 3464"

Private Sub ModelRetailPrice_AfterUpdate()
Forms![frmQuotes]!ModelRetailPrice = DLookup("ModelretailPrice",
"tblModel", "ModelID = " & Forms![frmQuotes]!ModelID)
End Sub

I am trying to populate the field [frmQuotes]!ModelRetailPrice with
the ModelRetailPrice from the tblModel based upon the ModelID input on
the [frmQuotes]!ModelID.

Thank you.

Alberto
 
J

John W. Vinson

I have run the following "event procedure" from a combo box and am
getting a "data type mismatch error: 3464"

Private Sub ModelRetailPrice_AfterUpdate()
Forms![frmQuotes]!ModelRetailPrice = DLookup("ModelretailPrice",
"tblModel", "ModelID = " & Forms![frmQuotes]!ModelID)
End Sub

I am trying to populate the field [frmQuotes]!ModelRetailPrice with
the ModelRetailPrice from the tblModel based upon the ModelID input on
the [frmQuotes]!ModelID.

Thank you.

Alberto

Is the datatype of ModelID perhaps Text? If so, you need the syntactically
required quotemarks:

DLookup("ModelretailPrice","tblModel", "ModelID = '" &
Forms![frmQuotes]!ModelID & "'")

For clarity (don't do it this way) that's

DLookup("ModelretailPrice","tblModel", "ModelID = ' " &
Forms![frmQuotes]!ModelID & " ' ")
 
A

acitarella

I have run the following "event procedure" from a combo box and am
getting a "data type mismatch error: 3464"
Private Sub ModelRetailPrice_AfterUpdate()
Forms![frmQuotes]!ModelRetailPrice = DLookup("ModelretailPrice",
"tblModel", "ModelID = " & Forms![frmQuotes]!ModelID)
End Sub
I am trying to populate the field [frmQuotes]!ModelRetailPrice with
the ModelRetailPrice from the tblModel based upon the ModelID input on
the [frmQuotes]!ModelID.
Thank you.

Is the datatype of ModelID perhaps Text? If so, you need the syntactically
required quotemarks:

DLookup("ModelretailPrice","tblModel", "ModelID = '" &
Forms![frmQuotes]!ModelID & "'")

For clarity (don't do it this way) that's

DLookup("ModelretailPrice","tblModel", "ModelID = ' " &
Forms![frmQuotes]!ModelID & " ' ")

--

             John W. Vinson [MVP]- Hide quoted text -

- Show quoted text -

Thanks John. When I do it this way, nothing happens when I enter in
the Model ID in the form (i.e. the ModelRetailPrice does not
populate).
 
A

Al Campagna

I have run the following "event procedure" from a combo box and am
getting a "data type mismatch error: 3464"
Private Sub ModelRetailPrice_AfterUpdate()
Forms![frmQuotes]!ModelRetailPrice = DLookup("ModelretailPrice",
"tblModel", "ModelID = " & Forms![frmQuotes]!ModelID)
End Sub
I am trying to populate the field [frmQuotes]!ModelRetailPrice with
the ModelRetailPrice from the tblModel based upon the ModelID input on
the [frmQuotes]!ModelID.
Thank you.

Is the datatype of ModelID perhaps Text? If so, you need the syntactically
required quotemarks:

DLookup("ModelretailPrice","tblModel", "ModelID = '" &
Forms![frmQuotes]!ModelID & "'")

For clarity (don't do it this way) that's

DLookup("ModelretailPrice","tblModel", "ModelID = ' " &
Forms![frmQuotes]!ModelID & " ' ")

--

John W. Vinson [MVP]- Hide quoted text -

- Show quoted text -

Thanks John. When I do it this way, nothing happens when I enter in
the Model ID in the form (i.e. the ModelRetailPrice does not
populate).


acitarella,
Try...
Refresh
DLookup("ModelretailPrice","tblModel", "ModelID =
Forms![frmQuotes]![ModelID]")
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top