2 buttons change to 1 button for one go

Hello,

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
0
Utf
1/4/2010 6:25:01 AM
access.formscoding 7493 articles. 0 followers. Follow

4 Replies
1014 Views

Similar Articles

[PageSpeed] 40

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

"Frank Situmorang" <FrankSitumorang@discussions.microsoft.com> wrote in 
message news:80CA7F05-12C0-4CD3-9394-BEFA94409E91@microsoft.com...
> Hello,
>
> 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 


0
Arvin
1/4/2010 1:10:46 PM
Would DoEvents be of any use (rather than the Delay function)?

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

0
BruceM
1/5/2010 12:45:15 PM
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.
-- 
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"BruceM via AccessMonster.com" <u54429@uwe> wrote in message 
news:a1a7f22aad3fe@uwe...

> Would DoEvents be of any use (rather than the Delay function)?
>
> 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
> 


0
Arvin
1/5/2010 11:09:27 PM
OK, thanks.  I have used DoEvents by itself, but am not convinced it is of
much use, at least not where I have tried to use it.  For instance, I seem to
recall stepping through code, which seemed to run OK, but when I run the code
without stepping through it stumbles over something.  I have tried in those
cases to add DoEvents, but I do not recall it helped.  I wish I could think
of the specifics.  Anyhow, if I run into that again I will try delaying for a
specific interval, and see if that helps.

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

0
BruceM
1/6/2010 12:51:41 PM
Reply:

Similar Artilces:

Major help needed!!!! #2
Thanks for the post GE, I was able to find another computer with exce 97 still loaded. I opened the existing spreadheet and went through th tools options and unchecked th 1904 date option. Went back to m updated computer and the dates came across just fine. Also thanks Don, your comment will be noted. I was in a rushed an panic'd state : -- KyDean ----------------------------------------------------------------------- KyDeano's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1556 View this thread: http://www.excelforum.com/showthread.php?threadid=27128 ...

Bart chart with lines showing % change between elements
I have 5 sets of data, each with a before and after amount that has been charted using a simple bar chart. Is it possible to have excel, using a line from the before element to the after element, show the % change between the two? I can easily calculate the percent change between the two, but if I graph it and set it to a line, the only way it can be seen is if I chart it on an alternate axis. Further, I just want a line from the top of the before element to the top of the after element, and a label showing the % change. Confused? Hope not :) Thanks for any help! I might be tempted to...

error 0x800ccc13 #2
I have Outlook 2000 installed on WinXP home. After installing modem software (for fax purposes) I now receive error 0x800ccc13 when performing 'send receive' in Outlook. Outlook Express now also fails with 0x800ccc0f error. I've disabled all spywatch and filtering software and tested Winsock using Netdiag and Winsock passes but there is a fail for NetBT transports test failed (I'm assuming because I removed all services other than TCP/IP.) I've reinstalled Outlook Express using the procedure from #318378 http://support.microsoft.com/default.aspx?scid=kb;en-us;318378&...

MS Publisher #2
Does anyone know how to open an MS Publisher 2000 document with MS Publisher 97? You cannot open a Publisher 2000 document in Publisher 97. You need the same or later version of Publisher to open Publisher documents. -- Why is it that people don't realize that they will probably have a problem opening a newer file with an older program? Rarely does that ever happen. "Riobard" <morgan.riobard@sivh.ie> wrote in message news:12b801c38ceb$868aea80$a401280a@phx.gbl... > Does anyone know how to open an MS Publisher 2000 document > with MS Publisher 97? Because t...

Help ! #2
Hi, I have developed an application in VC++ where spelling of a word will be checked in Excel (English is default). I have used Automation for this. I want to use the same application for German and French languages. Could someone help me on how to select the language programmatically so that selected language's dictionary will be activated and spelling of a word will be checked in that selected language's dictionary? TIA, Gary ...

Change shipping address does not roll down to item line
I recently migrate from GP 7.5 to GP 8.0, my user told me; when she changed the shipping address on item line, it does not roll down to other items. Because in version 7.5 there was a pop up message to ask if you want to roll down the changes to other item too, something like this. But she did not see this message again. How can I let the changes roll down to other items. 2. After migrate to GP 8.0 some user suddenly kicked off by system, so far as I know that nobody delete the concurrent user in User Activity. Is it some bugs in GP 8.0. I am using GP8.0 SP2. Thanks! I just teste...

Error adding users #2
Hello all: I am working with a new installation of MSCRM, and when I try to add a user I get the "AN error ahs occurred, please contact your system administrator" message. So I enabled tracing, and I have pasted the error details from the trace file below... Does anyone have any ideas? John. >MSCRM Application Error Report: -------------------------------------------------------------------------------------------------------- Error: Index was out of range. Must be non-negative and less than the size of the collection. >Parameter name: index Error Message: Index was ou...

RMS 2.0 Manual
I have a general question. I remember over year ago when we were buying RMS license we were receivig license+box with manual, user guide and Instalation CD. From some time whenever we order new license there is A2 cartboard "envelope" comming which have another A3 soft envelope in it and eventually this one ontains 10cm x 10cm RMS license sheet. Can someoe tell me is it just us or everybody have it this way. Before after we did training for customer he had Manual/User Guide to look back into if he forgot about something, I know that this manual is exact printout of ...

Qty sold/Qty available #2
Any way of doing this on a top performer report? I would like to see the qty sold and qty available per item, not individual sales. THANKS! CT >-----Original Message----- >CT, > >Detailed Sales Report and add the On Hand column. (right click on the >report, Show/Hide Columns) > >-- >Jeff > >Get Secure! - www.microsoft.com/security > >===================================================== > >When responding to posts, please "Reply to Group" via >your newsreader so that others may learn and benefit >from your issue. > >=======...

10.1.4: First Class--as far as it goes
The improvements found in version 10.1.4 clearly signal that Microsoft listens to users and has been responsive in making some of the improvements that a number of us have advocated in our email to mswish@microsoft.com I had hoped for more bug fixes and improvements, particularly in Entourage, but will have to look forward to the next version. The installation and my subsequent test of Office components went well. I had, as required, previously installed 10.1.2. None of Office's components were renamed. I ran Repair Permissions first, turned off Office Notifications, disabled Norton Anti...

Button for goal seek?! #2
Hello I have the following data: 5 6 12 15 20 Total of all those added I will have to set a goal seek button so that i can put the total i want and then change the cell i want i tried using a macro but i couldnt do it... I just want to do it using a click of a button instead of going to menu>goal seek>etc etc Thanks a lot From John -- Neo1 ------------------------------------------------------------------------ Neo1's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=30329 View this thread: http://www.excelforum.com/showthread.php?threadid=515571 Any ...

FTP #2
Greetings. I have an MFC application working just fine using ftp with CInternetSession and CFtpConnection, and I'm using windows ftp server. this app needs to check file's size and dates where CFtpFileFind seems to works perfectly. I have some doubts: 1. this app seems to work fine with filezila ftp server... is there somethig I have to know working with other ftp servers specially servers runing on linux? I have seen that list files is not standard... 2. MFC can handle FTPS?? if not, does any one knows a good library? I'm starting to see libcurl. Any suggestions are welc...

Environ(x) doesn't work for 1 user
I use Environ("username") to assign the network username to a variable. This works great except for one single user and it returns an error. I wrote a little function to print all the user environ variables and it works for that user, all the Environ variables are there. But I can't set any textbox to an Environ. All of her references match mine. We reinstalled Access - it's Access 03. I don't know where to go from here. Again, all other users have no problem. -- Regards Larry While I don't have an answer to your specific problem, my advise...

remove track changes
How do you remove "track changes" option from emailed documents? I am receiving documents by email with track changes. When I print, the document prints with the track changes. Help <Help@discussions.microsoft.com> wrote: > How do you remove "track changes" option from emailed documents? I am > receiving documents by email with track changes. When I print, the > document prints with the track changes. Click Tools>Options>E-mail Options. Uncheck "Mark my comments with". Or, if you're using Word as the editor, click Tools and un...

I'd like to change the color of shapes in a visio drawing programmatically...
How do i link a shape to a database and depending upon what the value is in that database, change the color of the shape? (i need to do this for multiple shapes in the document so do i link the entire drawing and then either in VBA or the shapesheets, enter code for this.) what would the code look like? cheers! You can update the formula in the shape.Cells("FillForegnd").Formula cell with either: a number from 0 to 23 (or more if you customise the color map) a valid RGB reference a valid HSL reference If you have a grouped shape, then you may need to enumerate ...

2 cells 2 colors
Hi All, Here's my glitch: I've got 2 dropdown/combo boxes in a user form. Both offer variou color options. The 1st one colors an active cell the correct color tha is chosen. The 2nd dropdown colors the cell directly to the right or th active cell in the same manner. My code is pretty crude & not ver efficient, but it works correctly. The problem is when color 2 is no chosen. Currently, if a color isn't chosen, I can put an "X" in th cell, or color it a certain color, but what I want is to color i whatever the color of the active cell is. Any ideas? Thanks -- S...

Forms.dic #2
Hi, I might have missed out something. After installing MGP v8.0 SP5 on the workstation, I then I clicked on Modifier, the system created a file called forms.dic. After this, I can't open certain forms like Sales Transaction Windows, Sales Order Fulfillment, Inventory Transaction, etc. Other forms like Item Class ID, Journal Entry are fine. Anything I miss out here? TIA, Sugih Were these forms modified? Is security pointing to the modified forms? The new forms.dic will be empty and not contain these forms. Most firms either copy a complete forms.dic from a working workstation ...

Outlook 2007
WinXP Pro SP3 Outlook 2007 - Pop3 Can outlook 2007 have mail stores (PST) greater than 2 GB? I have a friend who keeps all for his business and is pushing the limit. I was told that Outlook 2007 raised the limit. Any clarification is appreciated. -- ***************** John Lenz JohnLenz@comcast.net 20Gb + if using the new, default, pst file type of Unicode which is the default in Outlook 2003 and later If however you upgraded outlook from a pre 2003 version, then it maybe that you are still using the old outlook format data file which has the size limitation. Within Outlook, select ...

Disable room add rooms button in Scheduling Assistant
We are implementing a third party application (Meeting Room Manager) that uses Exchange Calendar data but maintains it's own database of conference rooms and features with enhancements over Exchange.. There is an Outlook plugin that installs, but users need to be forced to follow new calendaring/scheduling procedure and not be allowed to click on the Rooms or Add Rooms buttons in the Scheduling Assistant. We know we can hide the rooms in Exchange but are concerned this will generate calls. Have found documentation on Group Policy that willl block apps based on command bar id. ...

Office 97 to 2003: Excel: enter data w/fixed 2 decimal. 2000. be. #2
When I enter number "2000." I get 20.00 - yes, set decimals at 2 but earlier excel would accept change if you entered decimal with number. this is slowing down a budget prep and I'd sure like some help - online and tutorials say "enter decimal" but this is not working. what am I doing wrong? ...

matrix item in rms 2.0
When creating a matrix item in 2.0, and selecting the option to show the dimensions of the size and color with the description, I get a error message that "itemlookup code or item description exeeds the allowed length. do you wish to continue truncating the lookup code or description." However with the old version I was able to do this. Is the description field more restricted in size? Also it whould be easier to be able to enter the matrix reorder #,minimum order & case quantity when you create a matrx item, for now i have to do it with the wizard. Does anybody know ...

One Control for 2 codes
My Combo Box cbGSTOptions selects either tax or no tax but after making my selection I need to update with another control form the calculation to work Control 2 is under the line==== Can I incorporate these two code to just the Afterupdate of my Combo Box ---------------------------------------------------------------------- Option Compare Database Option Explicit Dim recInvoice_ItMdt As ADODB.Recordset Dim recInvoice As ADODB.Recordset, dblGSTContentsValue As Double, lngIntermediateID As Long Dim dblGSTOptionsValue As Double Dim bModify As Boolean Dim ynCheque As Boolean, ln...

Exchange 2007 Beta 2 question
Hi I have the mailbox, CA, hub and UM on one server. I am trying to create a new email life cycle policy, but the option to do this cannot be found. I right click on the mailbox icon in EMC under "organization" but the option is not listed. The only listed options are. Also the tab in ESM for this is not there New address list New managed custom folder new managed fodler mailbox policy new offline address list On Wed, 23 Aug 2006 13:58:02 -0700, skip <skip@discussions.microsoft.com> wrote: >Hi > >I have the mailbox, CA, hub and UM on one server. I am trying to...

2 X 2 Splitter Windows #2
What is wrong with the following code? I am trying to create a 2 X 2 splitter window. It should look like this. CMyTreeView | CMyListView __________________|___________________ | CPictureView | CDetailView It compiles correctly but when I run it I get an error in the WinSplit routine of MFC. if(!m_wndSplitterWnd1.CreateStatic(this,1,2)) return FALSE; if(!m_wndSplitterWnd1.CreateView(0,0, RUNTIME_CLASS(CMyTreeView), CSize(0,0), pContext)) return FALSE; if(!m_wndSplitterWnd2.CreateStatic(&m_wn...

Turning off formatting when tracking changes
When we are tracking changes, then save the document, and open it later, the formatting shows up on the right side of the page. When I click on the Review tab and unclick the arrow beside Formatting under show Mark-up, it goes away. Then I save, and every time I open it, it's back again. I only want to track the changes in the document, not the formatting itself, but it seems as if this is a default and I can NOT get it to go away....I don't want to accept the changes until appropriate folks have reviewed it, but when I send them the document, they all complain about t...