goldmedallist
Registered User.
- Local time
- Today, 23:07
- Joined
- Jun 24, 2005
- Messages
- 16
I was working along a code that seemed to work fine until all of a sudden, the next time I tried it it, it doesnt. It is a simple code really as below which is giong to be the foundation for a selection followed by SQL input into the record source of another form to generate results. I get the following error message
"Microsoft Access cant find the form "Querypurpose" referred to in a Macro expression or Visual Basic Code"
It doesnt make any sense to me since, if I were to take away the " Forms!Querypurpose.RecordSource = SQL" line, than everything works fine. Did I disable any function in the VB editor cos I was playing around with rst before it happened
Would anyone be able to explain why...thanks so much!
*****
Private Sub Command59_Click()
On Error GoTo Err_Command59_Click
Dim stDocName As String
Dim SQL As String
stDocName = "Querypurpose"
SQL = "SELECT ClientInfo.ClientName FROM ClientInfo;"
Forms!Querypurpose.RecordSource = SQL
DoCmd.OpenForm stDocName, acFormDS
Exit_Command59_Click:
Exit Sub
....
***
"Microsoft Access cant find the form "Querypurpose" referred to in a Macro expression or Visual Basic Code"
It doesnt make any sense to me since, if I were to take away the " Forms!Querypurpose.RecordSource = SQL" line, than everything works fine. Did I disable any function in the VB editor cos I was playing around with rst before it happened

Would anyone be able to explain why...thanks so much!
*****
Private Sub Command59_Click()
On Error GoTo Err_Command59_Click
Dim stDocName As String
Dim SQL As String
stDocName = "Querypurpose"
SQL = "SELECT ClientInfo.ClientName FROM ClientInfo;"
Forms!Querypurpose.RecordSource = SQL
DoCmd.OpenForm stDocName, acFormDS
Exit_Command59_Click:
Exit Sub
....
***