473,385 Members | 2,014 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

one command buton, three things to accomplish - help

hi all
here is my situation, any help will be appreciated

i have a form with two command buttons on it, listing update and append
arc

Private Sub listing_update_Click()
On Error GoTo Err_listing_update_Click

Dim stDocName As String

stDocName = "Listing Update"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_listing_update_Click:
Exit Sub

Err_listing_update_Click:
MsgBox Err.Description
Resume Exit_listing_update_Click

End Sub

Private Sub append_arc_Click()
On Error GoTo Err_append_arc_Click

Dim stDocName As String

stDocName = "append arc"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_append_arc_Click:
Exit Sub

Err_append_arc_Click:
MsgBox Err.Description
Resume Exit_append_arc_Click

End Sub

my question is, how can i do the same thing with just one button.
there is also another thing i would like to acomplish, after i click
the button and run the queries i would like to change the values in a
few text boxes on the same form back to 0

Nov 13 '05 #1
1 1437
Put the following code in the click event of a command button:
On Error GoTo ErrorHandler
DoCmd.OpenQuery "Listing Update", acNormal, acEdit
DoCmd.OpenQuery "append arc" , acNormal, acEdit
Me!MyTextbox1 = 0
Me!MyTextbox2 = 0
Me!MyTextbox3 = 0
....
....
ExitHere:
Exit Sub

ErrorHandler:
MsgBox Err.Description
Resume ExitHere

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com


"gbb0330" <gb*****@gmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
hi all
here is my situation, any help will be appreciated

i have a form with two command buttons on it, listing update and append
arc

Private Sub listing_update_Click()
On Error GoTo Err_listing_update_Click

Dim stDocName As String

stDocName = "Listing Update"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_listing_update_Click:
Exit Sub

Err_listing_update_Click:
MsgBox Err.Description
Resume Exit_listing_update_Click

End Sub

Private Sub append_arc_Click()
On Error GoTo Err_append_arc_Click

Dim stDocName As String

stDocName = "append arc"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_append_arc_Click:
Exit Sub

Err_append_arc_Click:
MsgBox Err.Description
Resume Exit_append_arc_Click

End Sub

my question is, how can i do the same thing with just one button.
there is also another thing i would like to acomplish, after i click
the button and run the queries i would like to change the values in a
few text boxes on the same form back to 0

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: calmar | last post by:
Hi all, I would like to use python for a replacement for some binutils. I would like to be able to pipe things into python. Actually I would not like writing a 'script' to handle the input, but...
13
by: Samantha Smit | last post by:
Hi, I am trying to create a simple asp page that has one command button that updates a database. The URL of the page is like this: http://MyServer.com/Update.asp?UserName=Tom My asp code is...
10
by: Steve | last post by:
Is there anyone with experience using the Winzip command line add-in? I can't get it to create the zip file with a space in the file name. Using: RetValue = Shell("C:\winzip\wzzip.exe...
2
by: Chris Bolus | last post by:
I'm a teacher using MS Access on an RMConnect 2.4 network. On some workstations both I and my students sometimes get an error message when attempting to insert a command button on a form which...
51
by: WindAndWaves | last post by:
Can anyone tell me what is wrong with the goto command. I noticed it is one of those NEVER USE. I can understand that it may lead to confusing code, but I often use it like this: is this...
6
by: Edd Dawson | last post by:
Hi. I have a strange problem involving the passing of command line arguments to a C program I'm writing. I tried posting this in comp.programming yesterday but someone kindly suggested that I'd...
2
by: orion1 | last post by:
I have created a table containing information relating to a paper based spreadsheet, i have created a field which is not displayed and is incremetal counting behind(primary key) I also have a Ref No...
3
by: gra | last post by:
Hi Access 2002 I have a Command Buton using some VB code to open an Excel spreadsheet. However, when the spreadsheet opens it doesn't refresh the data. The spreadsheet is a pivot table which...
3
by: shalini166 | last post by:
I have three option button.how to choose one at a time. if i select option1, then i select option2 two of them selected. pls help me
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.