i have the following code in the afterupdate event of a combo box which is used to filter some records in a table depending on the item selected in the combo box:-
Dim SupSql As String
Dim sSupp As String
sSupp = Trim(Me.TxtSupplier.Text)
If Not sSupp = "" And isdelorback = False Then
SupSql = "SELECT SupplierID, DocumentNo, DeliveryDate, Reference From TblOrders WHERE SupplierID Like '*" & sSupp & "*' ORDER BY DocumentNo ;"
CurrentDb.QueryDefs("QryGRTemp").SQL = SupSql
SupSql = "SELECT (Select Count(1) FROM QryGrTemp AS A WHERE A.DocumentNo <=QryGRTemp.DocumentNo) AS Sequence, QryGRTemp.* FROM QryGRTemp;"
Me.List4.RowSource = SupSql
End If
Me.List4.Requery
what i would like to know is, is this text ok for filtering by the documentno or do i need to change the text to suit a number and if so can someone please point me in the right direction.
Thanks
Gareth
Dim SupSql As String
Dim sSupp As String
sSupp = Trim(Me.TxtSupplier.Text)
If Not sSupp = "" And isdelorback = False Then
SupSql = "SELECT SupplierID, DocumentNo, DeliveryDate, Reference From TblOrders WHERE SupplierID Like '*" & sSupp & "*' ORDER BY DocumentNo ;"
CurrentDb.QueryDefs("QryGRTemp").SQL = SupSql
SupSql = "SELECT (Select Count(1) FROM QryGrTemp AS A WHERE A.DocumentNo <=QryGRTemp.DocumentNo) AS Sequence, QryGRTemp.* FROM QryGRTemp;"
Me.List4.RowSource = SupSql
End If
Me.List4.Requery
what i would like to know is, is this text ok for filtering by the documentno or do i need to change the text to suit a number and if so can someone please point me in the right direction.
Thanks
Gareth