I have 2 buttons to append data, 1st to put the file into a folder, the 2nd
is to make an append from that folder.
How can I make it to be just one button. This is my VBA:
The 1st one:
On Error GoTo Err_SendtoOutbox_Click
Call Shell("xcopy C:\Churchdata\BkEnd\Hahomion_be.mdb
C:\Churchdata\ChurchdataConso\BkEnd\Hahomion_be.mdb/y")
Exit_SendtoOutbox_Click:
Exit Sub
Err_SendtoOutbox_Click:
MsgBox Err.Description
Resume Exit_SendtoOutbox_Click
End Sub
The 2nde one:
Private Sub HFSUPDate_Click()
On Error GoTo Err_HFSUPDate_Click
DoCmd.SetWarnings False 'Turn messages back OFF
DoCmd.OpenQuery "Qry_update_tblDivisions", acNormal, acEdit
DoCmd.OpenQuery "Qry_update_tblUnions", acNormal, acEdit
DoCmd.OpenQuery "Qry_update_tblRegions", acNormal, acEdit
DoCmd.OpenQuery "Qry_update_tblChurches", acNormal, acEdit
DoCmd.OpenQuery "Qry_updatetblAffiliations", acNormal, acEdit
DoCmd.OpenQuery "Qry_updateMemberAddressData", acNormal, acEdit
DoCmd.OpenQuery "Qry_UpdateMembershipdata", acNormal, acEdit
'Add your other query here
DoCmd.SetWarnings True 'Turn messages back ON
Exit_HFSUPDate_Click:
Exit Sub
Err_HFSUPDate_Click:
MsgBox Err.Description
Resume Exit_HFSUPDate_Click
End Sub
Thanks for any help.
--
Frank Situmorang
http://www.datastrat.com/Code/Delay.txt
that can be added to a standard module, and called in your code between the
2 parts of your other code.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
"Frank Situmorang" <FrankSi...@discussions.microsoft.com> wrote in
message news:80CA7F05-12C0-4CD3...@microsoft.com...
Frank
Arvin Meyer [MVP] wrote:
Just put the code from both together without using the Exit and Error subsfrom
04-Jan-10
Just put the code from both together without using the Exit and Error subs
from the first one. You may need to add a slight delay between the 2 in
order to allow the first to complete. There is a Delay procedure at:
http://www.datastrat.com/Code/Delay.txt
that can be added to a standard module, and called in your code between the
2 parts of your other code.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
Previous Posts In This Thread:
Submitted via EggHeadCafe - Software Developer Portal of Choice
Spyware-Adware-Internet Driver License Test Redux
http://www.eggheadcafe.com/tutorials/aspnet/487aa9ed-8dd8-4e05-8df9-f1efa2b6054a/spywareadwareinternet-d.aspx
I have tried it but it stop in the Dalay with error message " Compile error" saying "Argument is not optional"
This is my code:
Private Sub HFSUPDate_Click()
On Error GoTo Err_HFSUPDate_Click
Call Shell("xcopy C:\Churchdata\BkEnd\Hahomion_be.mdb C:\Churchdata\ChurchdataConso\BkEnd\Hahomion_be.mdb/y")
Delay
DoCmd.SetWarnings False 'Turn messages back OFF
DoCmd.OpenQuery "Qry_update_tblDivisions", acNormal, acEdit
DoCmd.OpenQuery "Qry_update_tblUnions", acNormal, acEdit
DoCmd.OpenQuery "Qry_update_tblRegions", acNormal, acEdit
DoCmd.OpenQuery "Qry_update_tblChurches", acNormal, acEdit
DoCmd.OpenQuery "Qry_updatetblAffiliations", acNormal, acEdit
DoCmd.OpenQuery "Qry_updateMemberAddressData", acNormal, acEdit
DoCmd.OpenQuery "Qry_UpdateMembershipdata", acNormal, acEdit
'Add your other query here
DoCmd.SetWarnings True 'Turn messages back ON
Exit_HFSUPDate_Click:
Exit Sub
Err_HFSUPDate_Click:
MsgBox Err.Description
Resume Exit_HFSUPDate_Click
End Sub
Thanks for your help
Frank
Arvin Meyer [MVP] wrote:
Just put the code from both together without using the Exit and Error subsfrom
04-Jan-10
Just put the code from both together without using the Exit and Error subs
from the first one. You may need to add a slight delay between the 2 in
order to allow the first to complete. There is a Delay procedure at:
http://www.datastrat.com/Code/Delay.txt
that can be added to a standard module, and called in your code between the
2 parts of your other code.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
Previous Posts In This Thread:
Submitted via EggHeadCafe - Software Developer Portal of Choice
VB.NET Event Managment / Logging through Publisher / Subsriber Pattern
http://www.eggheadcafe.com/tutorials/aspnet/9734b345-d1a5-4898-8192-bfdf6fef6500/vbnet-event-managment-.aspx
I didn't read all your code, but this line is wrong and should be:
Call Shell("xcopy C:\Churchdata\BkEnd\Hahomion_be.mdb
C:\Churchdata\ChurchdataConso\BkEnd\Hahomion_be.mdb /y")
-Tom.
Microsoft Access MVP
Delay(1.5)
would allow a delay of 1.5 seconds. The time interval (argument) is not
optional.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
<Frank Situmorang> wrote in message
news:20101502612...@yahoo.com...
Arvin Meyer [MVP] wrote:
>You have to tell it how long to delay:
>
>Delay(1.5)
>
>would allow a delay of 1.5 seconds. The time interval (argument) is not
>optional.
>> Hello Arvin,
>>
>[quoted text clipped - 57 lines]
>> VB.NET Event Managment / Logging through Publisher / Subsriber Pattern
>> http://www.eggheadcafe.com/tutorials/aspnet/9734b345-d1a5-4898-8192-bfdf6fef6500/vbnet-event-managment-.aspx
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201001/1
"BruceM via AccessMonster.com" <u54429@uwe> wrote in message
news:a1a7f22aad3fe@uwe...
Arvin Meyer [MVP] wrote:
>DoEvents is what the Delay function uses, but allows a specific amount of
>time rather than letting the OS control whatever it wants to do for as long
>as it requires.
>> Would DoEvents be of any use (rather than the Delay function)?
>>
>[quoted text clipped - 9 lines]
>>>> VB.NET Event Managment / Logging through Publisher / Subsriber Pattern
>>>> http://www.eggheadcafe.com/tutorials/aspnet/9734b345-d1a5-4898-8192-bfdf6fef6500/vbnet-event-managment-.aspx
--
Message posted via http://www.accessmonster.com