By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,847 Members | 3,102 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,847 IT Pros & Developers. It's quick & easy.

Compile Error : Variable Not Defined

P: 29
Hi guys ! I am new here, i just wanna ask. I know the solution for this problem is simple but i just cannot figure it out......I get the error at the italized area.

Expand|Select|Wrap|Line Numbers
  1. Option Explicit
  2.  
  3. Dim pdbQue As DAO.Database
  4. Dim mrstQue As DAO.Recordset
  5. Dim querQue As DAO.Recordset
  6.  
  7. Private Sub Form_Load()
  8. Label7 = 1
  9. Set pdbQue = OpenDatabase(App.Path & "\Test Editor.mdb")
  10. Set mrstQue = pdbQue.OpenRecordset("SELECT * FROM Quest ORDER BY QuestionId")
  11. Set querQue = pdbQue.OpenRecordset("Quest Query", pdbQueOpenDynaset)
  12. Main.Que_No
  13. Main.Set_No
  14. Label9.Caption = Main.topic
  15. Command5.Enabled = False
  16. End Sub
  17.  
Jul 17 '07 #1
Share this Question
Share on Google+
3 Replies


JKing
Expert 100+
P: 1,206
Try changing this:
Expand|Select|Wrap|Line Numbers
  1. Set querQue = pdbQue.OpenRecordset("Quest Query", pdbQueOpenDynaset)
  2.  
To this:
Expand|Select|Wrap|Line Numbers
  1. Set querQue = pdbQue.OpenRecordset("Quest Query", dbOpenDynaset)
  2.  
Jul 17 '07 #2

P: 29
I tried that it does not work.....It still says invalid operation and highlights the whole line.....

Set querQue = pdbQue.OpenRecordset("Quest Query", dbOpenDynaset)

Maybe it has something to do with reference ?..... :(

Does anyone know what the problem could be ?....
Jul 18 '07 #3

JKing
Expert 100+
P: 1,206
So you're getting an invalid operation as opposed to an undefined variable error now?

Could you post the sql for "Quest Query"
Jul 18 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.