Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / July 2008

Tip: Looking for answers? Try searching our database.

Compile Error - Argument Not Optional

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tal - 31 Jul 2008 16:05 GMT
I am trying to code a command button to do all sorts of things at once, as
follows:

Private Sub btnPrintReceipt_Click()
DoCmd.SetWarnings False
DoCmd.OpenQuery.qryDonorAddressTotalUnreceiptedCZCADonations (This runs an
append query that generates the Receipt.)
DoCmd.OpenQuery.uqryAssignIssueDateCZCA (This runs an update query that adds
today's date to the Receipt)
DoCmd.OpenReport.rptCZCAReceipts (This opens the Receipt)
DoCmd.SetWarnings True
End Sub

I am getting a Compile Error - Argument Not Optional error and the highlight
is appearing on the Append query line.

Help please!!

Many thanks,
Talia
Dennis - 31 Jul 2008 16:11 GMT
Your syntax is wrong by using the dot operator in all your DoCmd statements
It should be
DoCmd.OpenQuery "qryDonorAddressTotalUnreceiptedCZCADonations"

> I am trying to code a command button to do all sorts of things at once, as
> follows:
[quoted text clipped - 16 lines]
> Many thanks,
> Talia
Tal - 31 Jul 2008 16:31 GMT
I think Dennis that I should win the
"Duh!!!" award for the day.
I have written these commands a bigillion times and yet I was getting all
caught up in whether it had something to do with the append query etc.
Thank you so much.
I would never have seen something so unbelievably obvious.
And thank you for your patience with such a "Duh!!" question.

Cheers,
Talia

> Your syntax is wrong by using the dot operator in all your DoCmd statements
> It should be
[quoted text clipped - 20 lines]
> > Many thanks,
> > Talia
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.