Group:  Microsoft Access » microsoft.public.access.formscoding
Thread: dlookup and 3464

Geek News

dlookup and 3464
acitarella[ at ]gmail.com 12/3/2008 3:23:32 AM
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

Re: dlookup and 3464
John W. Vinson <jvinson[ at ]STOP_SPAM.WysardOfInfo.com> 12/3/2008 3:57:16 AM
On Tue, 2 Dec 2008 19:23:32 -0800 (PST), acitarella[ at ]gmail.com wrote:

[Quoted Text]
>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 & " ' ")

--

John W. Vinson [MVP]
Re: dlookup and 3464
acitarella <acitarella[ at ]gmail.com> 12/3/2008 11:41:30 AM
On Dec 2, 10:57 pm, John W. Vinson
<jvinson[ at ]STOP_SPAM.WysardOfInfo.com> wrote:
[Quoted Text]
> On Tue, 2 Dec 2008 19:23:32 -0800 (PST), acitare...[ at ]gmail.com wrote:
> >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 & " ' ")
>
> --
>
>              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).
Re: dlookup and 3464
"Al Campagna" <newsgroups[ at ]comcast.net> 12/3/2008 4:22:16 PM
"acitarella" <acitarella[ at ]gmail.com> wrote in message
news:9c44bfeb-9dc9-45fe-8cfd-dcf6293ec28d[ at ]f20g2000yqg.googlegroups.com...
On Dec 2, 10:57 pm, John W. Vinson
<jvinson[ at ]STOP_SPAM.WysardOfInfo.com> wrote:
[Quoted Text]
> On Tue, 2 Dec 2008 19:23:32 -0800 (PST), acitare...[ at ]gmail.com wrote:
> >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 & " ' ")
>
> --
>
> 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."


Re: dlookup and 3464
"Mike Painter" <mddotpainter[ at ]sbcglobal.net> 12/3/2008 6:19:57 PM
acitarella wrote:
[Quoted Text]
> On Dec 2, 10:57 pm, John W. Vinson
> <jvinson[ at ]STOP_SPAM.WysardOfInfo.com> wrote:
>> On Tue, 2 Dec 2008 19:23:32 -0800 (PST), acitare...[ at ]gmail.com wrote:
>>> 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 & " ' ")
>>
>> --
>>
>> 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).
You probably want it in the after update event for the Model ID.
If you relate the tables involved there is no need for a DLookup.
It would also make easier showing the description.


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net