I have an Input Box that willl receive a numeric input. I want to assign the value to an inyeger variable and use it in a where clause in a sqlStr. Is this possible. What is the syntax. Below is the portion of cose I'm tryiong to do.
CoID = InputBox("Enter a Company ID Number", "Company ID"
strSQL = "Select * from tblpayments where IDNumber= &CoID order by PaymentDate"
Set RST1 = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)
I keep getting a syntax error. If i just put a numeric value like " where IDNumber = (1) " it works just fine, but I want to allow the user to enter a Value for IDNumber.
Any help would be greatly appreciated
CoID = InputBox("Enter a Company ID Number", "Company ID"

strSQL = "Select * from tblpayments where IDNumber= &CoID order by PaymentDate"
Set RST1 = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)
I keep getting a syntax error. If i just put a numeric value like " where IDNumber = (1) " it works just fine, but I want to allow the user to enter a Value for IDNumber.
Any help would be greatly appreciated