SQLScholar
Programmer
Hey all
I am trying to hide a text box - based on a query that runs on the database (its an ADP so database is SQL).
I have the below:
However I get an error on that last line saying "Object variable or With Block variable not set.
Any ideas? I am guessing it could be that i am not really connecting to access - but to SQL.
Dan
----------------------------------------
Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind - Bernard Baruch
Computer Science is no more about computers than astronomy is about telescopes - EW Dijkstra
----------------------------------------
I am trying to hide a text box - based on a query that runs on the database (its an ADP so database is SQL).
I have the below:
Code:
Dim rs As DAO.Recordset
Dim db As DAO.Database
Dim strSQL As String
Set db = CurrentDb()
strSQL = "SELECT col1, col2, col3 FROM tablename WHERE fields = '" & database.form.txtbox & "'"
Set rs = db.OpenRecordset(strSQL)
However I get an error on that last line saying "Object variable or With Block variable not set.
Any ideas? I am guessing it could be that i am not really connecting to access - but to SQL.
Dan
----------------------------------------
Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind - Bernard Baruch
Computer Science is no more about computers than astronomy is about telescopes - EW Dijkstra
----------------------------------------