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 / Queries / August 2007

Tip: Looking for answers? Try searching our database.

Event Button

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
spcscooter - 14 Aug 2007 22:31 GMT
Hello All,

I have a button I need to use in a form to run the following Append Queries

Aerial Lift Append, CPR Append, Defensive Driving Append, Flagging Append,
Forklift Append, Ladder Handling Append, and Pole Climbing Append

I am using this for the Aerial Lift Append but want to be able to add the
others at the same time.

Private Sub Command13_Click()
On Error GoTo Err_Command13_Click

   Dim stDocName As String

   stDocName = "Aerial Lift Append"
   DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_Command13_Click:
   Exit Sub

Err_Command13_Click:
   MsgBox Err.Description
   Resume Exit_Command13_Click
   
End Sub

Will you help me PLEASE?!!!

Signature

Scot Rawlings
Technical Trainer
Comcast
Auburn, WA

fredg - 14 Aug 2007 22:45 GMT
> Hello All,
>
[quoted text clipped - 24 lines]
>
> Will you help me PLEASE?!!!

Do you wish to get a Warning message for each query?
If Not, then use SetWarnings False

Private Sub Command13_Click()
On Error GoTo Err_Command13_Click

    Dim stDocName As String

    DoCmd.SetWarnings False
   
    stDocName = "Aerial Lift Append"
    DoCmd.OpenQuery stDocName
   
    DoEvents
 
    stDocName = "CPR Append"
    DoCmd.OpenQuery stDocName
   
    DoEvents
   
    etc... for each additional query
   
   DoCmd.SetWarnings True

Exit_Command13_Click:
    Exit Sub

Err_Command13_Click:
    MsgBox Err.Description
    Resume Exit_Command13_Click
   
End Sub

Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

John Spencer - 15 Aug 2007 12:47 GMT
You should be able to do something like the following
Private Sub Command13_Click()
On Error GoTo Err_Command13_Click

Dim dbAny as DAO.Database
Set dbAny = CurrentDb()

dbAny.Execute "Aerial Lift Append", dbfailOnError
'Optional  code on next line
   Msgbox "Added " & dbAny.RecordsAffected & " Aerial Lift records"

dbany.Execute "CPD Append", dbfailOnError

dbAny.Execute ...

Signature

John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
.

> Hello All,
>
[quoted text clipped - 25 lines]
>
> Will you help me PLEASE?!!!
 
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.