I am writing a small VBA application for out ERP package. I have to query a databse in VBA to get a result set. I have two order numbers that I compare in my query. I dont know why but query always returns 0 records. I dont know if my "" are wrongly placed or its a diffirent issue.
Here is my code.
qry$ = "SELECT OEORDHDR_SQL.ord_no, OEORDHDR_SQL.shipping_dt FROM OEORDHDR_SQL WHERE OEORDHDR_SQL.ord_no >= " & macForm.StartingOrderNo.Text & " AND OEORDHDR_SQL.ord_no <= " & macForm.EndingOrderNo.Text & ""
RS.Open qry$
macForm.StartingOrderNo.Text and macForm.EndingOrderNo.Text are the two fields holding the Order Numbers. OEORDHDR_SQL.ord_no is a 8 char field in a SQL db.
I can only access the .Text property of the macForm.StartingOrderNo and macForm.EndingOrderNo not the .Value property.
Any help will be appreciated. Thanks.
Here is my code.
qry$ = "SELECT OEORDHDR_SQL.ord_no, OEORDHDR_SQL.shipping_dt FROM OEORDHDR_SQL WHERE OEORDHDR_SQL.ord_no >= " & macForm.StartingOrderNo.Text & " AND OEORDHDR_SQL.ord_no <= " & macForm.EndingOrderNo.Text & ""
RS.Open qry$
macForm.StartingOrderNo.Text and macForm.EndingOrderNo.Text are the two fields holding the Order Numbers. OEORDHDR_SQL.ord_no is a 8 char field in a SQL db.
I can only access the .Text property of the macForm.StartingOrderNo and macForm.EndingOrderNo not the .Value property.
Any help will be appreciated. Thanks.