Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

combo box data type

0 views
Skip to first unread message

acha...@gmail.com

unread,
Nov 10, 2009, 9:18:32 PM11/10/09
to
i am trying to have 2 combo boxes, 1st box is to display boxNumber,
2nd combo box is to display ChipID based on the selection of 1st combo
box... 1st combo box is getting list of value from a table which
stores number values. This works fine as i can link to table.field and
get the numbers to show on the drop down. Then,
I have "AfterUpdate" event with combo1. and here's SQL to display
value in combo2 (ChipID).
Me.Combo2.RowSource = "SELECT ChipID from ChipID " & _
"WHERE BoxNumber = " + Me.Combo1 + " AND ChipDateOut IS NULL "

However, i am getting "Type mismatch" error...
I noticed Me.Combo1 is showing the value without the double quote (").
For example, combo1 value=1, it's showing just 1 instead of "1" in the
runtime mode.
if i replace combo1 with text1 (a new text box) and put in 1, it would
display as "1" in the runtime and SQL would work.

anyone has any ideas what's wrong?!
Appreciate any input and help!

Tom van Stiphout

unread,
Nov 10, 2009, 10:19:03 PM11/10/09
to
On Tue, 10 Nov 2009 18:18:32 -0800 (PST), "acha...@gmail.com"
<acha...@gmail.com> wrote:

In VBA, the string concatenator is "&", not "+".

Are you really sure you have a table named "ChipID" with a column
named "ChipID"? That's highly unusual and NOT recommended - if it is
even legal.

What is the RowSource of your first combobox? Me.Combo1 will retrieve
the bound value. To check what it is, when you have the form open, hit
Ctrl+G to go to the Immediate window where you can type:
?Me.Combo1

-Tom.
Microsoft Access MVP

0 new messages