Sql

IanT

Registered User.
Local time
Today, 22:55
Joined
Nov 30, 2001
Messages
191
Hi
I am using the code below to supply the record source to a form. Unfortuantly the sql is not working! Can anyone help!





Dim strNewRecord As String
Dim strSupplier As String

If IsNull(Me.cboSupplier.Value) Then
strSupplier = " Like '*' "
Else
strSupplier = "='" & Me.cboSupplier.Value & "' "
End If

strNewRecord = "SELECT * FROM qryProducts " _
& " WHERE (((qryProducts.Supplier) Like '" * " & strSupplier & " * "'))"

Me.RecordSource = strNewRecord
 
strNewRecord = "SELECT * FROM qryProducts " _
& " WHERE (((qryProducts.Supplier) Like '*" & strSupplier & "*'))"

Greetz
 

Users who are viewing this thread

Back
Top Bottom