Im trying to get a form to search a query using SQL for an ID. The sql which im using is.
SELECT tblCustomer.Cus tomerName, tblCustomer.Cus tomerID, tblOrder.OrderI D
FROM tblCustomer INNER JOIN tblOrder ON tblCustomer.Cus tomerID = tblOrder.Custom erID
WHERE (((tblCustomer. CustomerName)=[enter name]));
Im trying to open that query and search for a value where the tickbox has been selected.
[CODE=vb]Private Sub Command5_Click( )
Dim rstCustomer As ADODB.Recordset
Dim conDatabase As ADODB.Connectio n
Dim strSQL As String
Dim strConditions As String
Set conDatabase = CurrentProject. Connection
If Check10.Value = True Then
strSQL = "SELECT * FROM QryFindOrders where CustomerName = " & Text1
MsgBox (strSQL)
DoCmd.OpenQuery "QryFindOrd ers"
End Sub[/CODE]
OK ive got it to open the query but its not searching for the value.
SELECT tblCustomer.Cus tomerName, tblCustomer.Cus tomerID, tblOrder.OrderI D
FROM tblCustomer INNER JOIN tblOrder ON tblCustomer.Cus tomerID = tblOrder.Custom erID
WHERE (((tblCustomer. CustomerName)=[enter name]));
Im trying to open that query and search for a value where the tickbox has been selected.
[CODE=vb]Private Sub Command5_Click( )
Dim rstCustomer As ADODB.Recordset
Dim conDatabase As ADODB.Connectio n
Dim strSQL As String
Dim strConditions As String
Set conDatabase = CurrentProject. Connection
If Check10.Value = True Then
strSQL = "SELECT * FROM QryFindOrders where CustomerName = " & Text1
MsgBox (strSQL)
DoCmd.OpenQuery "QryFindOrd ers"
End Sub[/CODE]
OK ive got it to open the query but its not searching for the value.
Comment