sdhruv
06-11-2015, 08:56 PM
I am trying to run a query everytime a certain form is loaded so I made an on load event and wrote the following code:
Private Sub Form_Load()
q = db.Execute(Query2, acViewNormal, acEdit)
End Sub
It works at the start but then crashes into a run time error 424 object required.
I also tried:
Private Sub Form_Load()
q = Docmd.OpenQuery(Query2, acViewNormal, acEdit)
End Sub
It also works initially before crashing into a compile error xpected Function or expression
Please help I do not know whats wrong or if there is another way to do it.
Private Sub Form_Load()
q = db.Execute(Query2, acViewNormal, acEdit)
End Sub
It works at the start but then crashes into a run time error 424 object required.
I also tried:
Private Sub Form_Load()
q = Docmd.OpenQuery(Query2, acViewNormal, acEdit)
End Sub
It also works initially before crashing into a compile error xpected Function or expression
Please help I do not know whats wrong or if there is another way to do it.