G
Guest
I am working on a class assignment. We had to create a queries dialog box.
Then create a load event. It is to select the first query in the list. This
is the code the book says to use:
Private Sub Form_Load()
'Move the focus to the list box and then to the first query in the list
box.
1stQueryList.SetFocus
SendKeys "(Down)"
End Sub
I used a 1 in the example instead of an L because thats what it looks like
in the book. However, this will not work I keep geting a Run Time error 424.
The next problem is we made a command button to open the selected query from
the list. It is supposed to open the query by either double clicking on the
query or using the button. The code for the button is:
Private Function DisplayQuery()
' Open the selected query in Datasheet view.
DoCmd.OpenQuery 1stQueryList, acViewNormal
End Function
I get an error message that says Access doesnt not recognize it.Then for the
On Dbl Click for the Query Box we are to put in =DisplayQuery(). This will
not work either.
Then create a load event. It is to select the first query in the list. This
is the code the book says to use:
Private Sub Form_Load()
'Move the focus to the list box and then to the first query in the list
box.
1stQueryList.SetFocus
SendKeys "(Down)"
End Sub
I used a 1 in the example instead of an L because thats what it looks like
in the book. However, this will not work I keep geting a Run Time error 424.
The next problem is we made a command button to open the selected query from
the list. It is supposed to open the query by either double clicking on the
query or using the button. The code for the button is:
Private Function DisplayQuery()
' Open the selected query in Datasheet view.
DoCmd.OpenQuery 1stQueryList, acViewNormal
End Function
I get an error message that says Access doesnt not recognize it.Then for the
On Dbl Click for the Query Box we are to put in =DisplayQuery(). This will
not work either.