Erratic Code

George Too

Registered User.
Local time
Today, 09:13
Joined
Aug 12, 2002
Messages
198
Can anyone tell why is this code asking me to enter parameter values twice? Isn't supposed to get the values from the combo boxes?
(this code is in the after_update event in the last of 3 combo boxes that filter the records).

***********************************************
Dim strSQLSF As String

strSQLSF = " SELECT * FROM tblMain "
strSQLSF = strSQLSF & " WHERE tblMain.Complaint_Information = '" & cboComplaintField & "' And "
strSQLSF = strSQLSF & " tblMain.Customer = '" & cboCustomerField & "' And "
strSQLSF = strSQLSF & " tblMain.Location = " & cboLocationField

Me.subfrmQuery.LinkChildFields = ""
Me.subfrmQuery.LinkMasterFields = ""

Me.subfrmQuery.LinkChildFields = "Complaint_Information;Customer;Location"
Me.subfrmQuery.LinkMasterFields = "Complaint_Information;Customer;Location"
Me.RecordSource = strSQLSF
Me.Requery
***************************************************
Thanks,
George
 
I expect it's asking for the parameters as you haven't specified where cbo...comes from. Try using me.cbo...


strSQLSF = "SELECT * FROM tblMain " _
& " WHERE tblMain.Complaint_Information = '" & Me.cboComplaintField & "' And " _
& " tblMain.Customer = '" & Me.cboCustomerField & "' And " _
& " tblMain.Location = " & Me.cboLocationField & ";"
 
Last edited:

Users who are viewing this thread

Back
Top Bottom