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

use combobox value in a query

Status
Not open for further replies.

230173

MIS
Jun 22, 2001
208
SG
Hi,

I'm having problems with a form where i have a combobox that's filled with
data from a textfield.

So this is the code i use for the combobox after_update event:
Dim strsql As String

strsql = "TRANSFORM Sum([CountOfMACHINE]) AS [SumOfCountOfMACHINE] SELECT
[MACHINE] FROM " _
& "[q_aantal machines_pe_afdeling] GROUP BY [MACHINE] PIVOT
[AFDELING] " _
& "HAVING ((tblAFDELING.AFDELING=""" & CStr(Me.Combo22.Text)
& """));"

Debug.Print strsql
Me.Graph29.RowSource = strsql
Me.Graph29.Requery

And this is the debug output:
TRANSFORM Sum([CountOfMACHINE]) AS [SumOfCountOfMACHINE] SELECT [MACHINE]
FROM [q_aantal machines_pe_afdeling] GROUP BY [MACHINE] PIVOT [AFDELING]
HAVING ((tblAFDELING.AFDELING="Zinkroom"));

The comobox value is correct but I get this error:
Syntax error (missing operator) in query expression '[AFDELING] HAVING
(((tblAFDELING.AFDELING) = "Zinkroom"))'.

What syntax error do I have?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top