
Originally Posted by
rivereridanus
Hello!
I am trying to write a code to allow a user (learning SQL) to type in a simple SELECT FROM WHERE etc... statement into a textbox txtrunsql, and upon on_click event open that recordset.
Private Sub cmdrunsql_Click()
Dim dbsMenuStudy As DAO.Database
Dim rstadhoc As DAO.Recordset
Dim strSQL As String
Set dbsMenuStudy = Currentdb
strSQL = Me.txtrunsql
Set rstadhoc = dbsMenuStudy.OpenRecordset(strSQL)
End Sub
When I click the button, nothing happens.
Any suggestions would be wonderful!