Changing code for text to numbers

Gazza2

Registered User.
Local time
Today, 09:58
Joined
Nov 25, 2004
Messages
184
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
 
WHAT text? this?
Code:
WHERE A.DocumentNo <=QryGRTemp.DocumentNo
yes, that's fine. the syntax changes if you're concating using a form control or var.
 
Basically i had this code for a search form by customer accountcode which was text and works perfectly but im am triying to setup a search form by document number which is a number. the part i think may be wrong is this part:-

SupSql = "SELECT SupplierID, DocumentNo, DeliveryDate, Reference From TblOrders WHERE SupplierID Like '*" & sSupp & "*' ORDER BY DocumentNo ;"

I may be wrong but i just cant seem to get this part and then a second part of code to work( the second part is another question when i figure this one out)

Thanks in advance
Gareth
 

Users who are viewing this thread

Back
Top Bottom