HI
I have a form with a few buttons. Each button runs a few lines of code.the code have queries also in them like "select * from table where number =6"
now if i want to give the number as a input in the form, how do i go about it.
HI
I have a form with a few buttons. Each button runs a few lines of code.the code have queries also in them like "select * from table where number =6"
now if i want to give the number as a input in the form, how do i go about it.
Update your button code to generate the query string as :
"SELECT * FROM myTable WHERE myNumber =" & me.controls("myControlName").value
You might feel the need to make sure that the "myControlName" control allows only numbers/do not accept null, or treat all cases in your procedure
myQuery = "SELECT * FROM myTable"
If Isnull(me.controls("myControlName").value) then
Else
If isnumeric(me.controls("myControlName").value) then
myQuery = myQuery & " WHERE myNumber =" & me.controls("myControlName").value
Else
msgBox me.controls("myControlName").value & " is not accepted"
Exit function
Endif
Endif