ethan.geerdes
Registered User.
- Local time
- Yesterday, 19:44
- Joined
- Jun 4, 2015
- Messages
- 116
I have a query that is ran when I click a button. the result pops up but it comes up behind the form and i need the focus to shift and have it be up front.
I am getting an error with this code, so I commented out the part which I thought would give me the correct result. Any information on this would be awesome. I don't know the syntax for referencing a query in VBA. I got a whole bunch of results for specifying a table though when I searched Google. I thought I would bring it up to the "Access gods". Any help would be greatly appreciated.
Code:
Private Sub Command11_Click()
On Error GoTo Err_Command11_Click
Dim stDocName As String
stDocName = "system_qry"
DoCmd.OpenQuery stDocName, acNormal, acEdit
'stDocName.SetFocus
Exit_Command11_Click:
Exit Sub
I am getting an error with this code, so I commented out the part which I thought would give me the correct result. Any information on this would be awesome. I don't know the syntax for referencing a query in VBA. I got a whole bunch of results for specifying a table though when I searched Google. I thought I would bring it up to the "Access gods". Any help would be greatly appreciated.