On Sep 28, 8:17 pm, Bob Quintal <rquin...@sPAmpatico.cawrote:
thebarefootnat...@googlemail.com wrote innews:11*********************@22g2000hsm.googlegr oups.com:
Hi
I have the following error message "Syntax Error (missing
operator)
in
query expression" occurring when I am trying to update combo box
within a form.
My code is:
Dim strSQL As String
Me.DESCRIPTION.Value = ""
strSQL = "SELECT DISTINCT [Description] FROM tblAnzsic_Codes_Info
WHERE Industry = '" & Me.INDUSTRY & "' AND Sub_Division = '" &
Me.SUB_DIVISION & "' AND Group = '" & Me.GROUP & "'"
Me.DESCRIPTION.RowSource = strSQL
This code is produce a list in the "Description" combo box based
upon
the values selected in the previous combo boxes.
Any help would be appreciated.
If the strSQL definition is all on one line it should work. (I can't
tell from here as my reader wraps text.)
Before setting the rowsource, do a debug,print strSQL. that will
show the string in the immediate window, {Ctrl-G} to make it visible
and examine the string to see if there are any missing spaces, or
other issues.
--
Bob Quintal
PA is y I've altered my email address.
--
Posted via a free Usenet account fromhttp://www.teranews.com- Hide quoted text -
- Show quoted text -
Hi,
I tried using the quotes around strSQL and brackets around Group but
it don't work.
My str SQL code is all one line.
Dim strSQL As String
Me.DESCRIPTION.Value = ""
strSQL = "SELECT DISTINCT [Description] FROM tblAnzsic_Codes_Info
WHERE Industry = '" & Me.INDUSTRY & "' AND Sub_Division = '" &
Me.SUB_DIVISION & "' AND Group = '" & Me.GROUP & "'"
Me.DESCRIPTION.RowSource = strSQL
Any other ideas?
Thanks