print query button

J

JohnLute

I'm going nuts trying to reolve my print query button. It returns "Wrong
number of arguments" around where I've placed < >:

Private Sub qryPrint_Click()
On Error GoTo Err_Print_Click

Dim strDocName As String
Dim stLinkCriteria As String

'Check to see that ending date is later than beginning date.
If IsDate(BeginningDate) And IsDate(EndingDate) Then
If EndingDate < BeginningDate Then
MsgBox "The ending date must be later than the beginning date."
SelectDate.SetFocus
Exit Sub
End If
End If

strDocName = Me!cbSelectQuery
DoCmd.< OpenQuery > Me!cbSelectQuery, acNormal, acEdit _
, , strWhere

Exit_Print_Click:
Exit Sub

Err_Print_Click:
MsgBox Err.Description
Resume Exit_Print_Click

End Sub

Any help would be greatly appreciated!

Thanks!
 
K

krissco

DoCmd. said:
, , strWhere

I don't know what version of Access you are running, but the syntax
for DoCmd.OpenQuery in A2k is:
DoCmd.OpenQuery queryname[, view][, datamode]
Three arguments - two optional.

Try highlighting "OpenQuery" and press F1 for help.

-Kris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top