Compile Error : Variable Not Defined

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • redskycorp
    New Member
    • Jul 2007
    • 29

    #1

    Compile Error : Variable Not Defined

    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.

    Code:
    Option Explicit
    
    Dim pdbQue As DAO.Database
    Dim mrstQue As DAO.Recordset
    Dim querQue As DAO.Recordset
    
    Private Sub Form_Load()
    Label7 = 1
    Set pdbQue = OpenDatabase(App.Path & "\Test Editor.mdb")
    Set mrstQue = pdbQue.OpenRecordset("SELECT * FROM Quest ORDER BY QuestionId")
    Set querQue = pdbQue.OpenRecordset("Quest Query", [I][B]pdbQueOpenDynaset[/B][/I])
    Main.Que_No
    Main.Set_No
    Label9.Caption = Main.topic
    Command5.Enabled = False
    End Sub
  • JKing
    Recognized Expert Top Contributor
    • Jun 2007
    • 1206

    #2
    Try changing this:
    [code=vb]
    Set querQue = pdbQue.OpenReco rdset("Quest Query", pdbQueOpenDynas et)
    [/code]
    To this:
    [code=vb]
    Set querQue = pdbQue.OpenReco rdset("Quest Query", dbOpenDynaset)
    [/code]

    Comment

    • redskycorp
      New Member
      • Jul 2007
      • 29

      #3
      I tried that it does not work.....It still says invalid operation and highlights the whole line.....

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

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

      Does anyone know what the problem could be ?....

      Comment

      • JKing
        Recognized Expert Top Contributor
        • Jun 2007
        • 1206

        #4
        So you're getting an invalid operation as opposed to an undefined variable error now?

        Could you post the sql for "Quest Query"

        Comment

        Working...