Using single button to run multiple query

I want to use single button on the form to run multiple queries. How it can 
be done? Where should I write queries and code?
0
Utf
12/8/2007 10:58:00 AM
access.formscoding 7493 articles. 0 followers. Follow

3 Replies
1337 Views

Similar Articles

[PageSpeed] 29

One way to do this would be to create your queries, then use the command
button to run code that calls each query.  Another approach would be to
create all your queries, then create a macro that runs all your queries, and
call that macro using code behind a command button.

-- 
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP
http://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

"Gajanan" <Gajanan@discussions.microsoft.com> wrote in message
news:B5EF1662-7C68-4A74-910C-9F2B5370E4F7@microsoft.com...
> I want to use single button on the form to run multiple queries. How it
can
> be done? Where should I write queries and code?

0
Jeff
12/8/2007 1:39:19 PM
Can you provide me sample code?

"Jeff Boyce" wrote:

> One way to do this would be to create your queries, then use the command
> button to run code that calls each query.  Another approach would be to
> create all your queries, then create a macro that runs all your queries, and
> call that macro using code behind a command button.
> 
> -- 
> Regards
> 
> Jeff Boyce
> www.InformationFutures.net
> 
> Microsoft Office/Access MVP
> http://mvp.support.microsoft.com/
> 
> Microsoft IT Academy Program Mentor
> http://microsoftitacademy.com/
> 
> "Gajanan" <Gajanan@discussions.microsoft.com> wrote in message
> news:B5EF1662-7C68-4A74-910C-9F2B5370E4F7@microsoft.com...
> > I want to use single button on the form to run multiple queries. How it
> can
> > be done? Where should I write queries and code?
> 
> 
0
Utf
12/9/2007 4:42:00 AM
DoCmd.OpenQuery "YourFirstQueryName"
DoCmd.OpenQuery "YourSecondQueryName"
....

-- 
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP
http://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

"Gajanan" <Gajanan@discussions.microsoft.com> wrote in message
news:27D48AB8-AD54-458A-BC75-FBCF7A72D328@microsoft.com...
> Can you provide me sample code?
>
> "Jeff Boyce" wrote:
>
> > One way to do this would be to create your queries, then use the command
> > button to run code that calls each query.  Another approach would be to
> > create all your queries, then create a macro that runs all your queries,
and
> > call that macro using code behind a command button.
> >
> > -- 
> > Regards
> >
> > Jeff Boyce
> > www.InformationFutures.net
> >
> > Microsoft Office/Access MVP
> > http://mvp.support.microsoft.com/
> >
> > Microsoft IT Academy Program Mentor
> > http://microsoftitacademy.com/
> >
> > "Gajanan" <Gajanan@discussions.microsoft.com> wrote in message
> > news:B5EF1662-7C68-4A74-910C-9F2B5370E4F7@microsoft.com...
> > > I want to use single button on the form to run multiple queries. How
it
> > can
> > > be done? Where should I write queries and code?
> >
> >

0
Jeff
12/9/2007 1:10:56 PM
Reply:

Similar Artilces:

Use Form to prompt for report criteria
I have a form that I am using to prompt for report criteria. When I run the query outside of the form, it works fine - prompting me for both criteria. However when I run from the form, I get #Error#. Can you see what I am doing wrong? Thanks in advance. I have two combo boxes that I have put in my underlying query. In the fields of the query are: [Forms]![frmSelection Criteria Form]![OfficeNumber] [Forms]![frmSelection Criteria Form]![Manager] *** On the OnClick event is the following: Private Sub Command6_Click() On Error GoTo Err_command6_Click Dim stDocName As String st...

Controlling multiple TCP connections from Outlook 2003 clients
I've noticed that Outlook 2003 clients can have multiple TCP connections to the mailbox store on Exchange. As the following web link claims: http://www.windowsitpro.com/Article/ArticleID/46319/46319.html "This behavior is by design. Outlook can open multiple connections to parallelize its data communications with the Exchange server. The actual number of connections will vary according to the version of Outlook that you're using and the mode in which you're using it. For Microsoft Office Outlook 2003 in Cached Exchange Mode, you'll see four connections for the mailbox, ...

OL2003 (Exchange) and OE6 running in the same PC
We are currently upgrading our OS from W98SE to WinXP. Our VP is using Netscape v4.67 with dial-up to access his personal email from the ISP and Novell Groupwise for his internal corporate email. With the new WinXP, he will be authenticate to Active Directory and using Exchange 2003 (Outlook 2003) for corporate email. (Yep, no more Groupwise!!) I want to move him away from Netscape to OE6 (built-in with XP pro). During my test in the lab, for some reasons I can't have OE6 and OL2003 running at the same time. (I can launch either one but not both at the same time) He wants OE6 as his...

converting tabular structures in a Word document into an actual table or reading data from the tabular structures using VBA code
I have a macro which can read the last cell/column of all tables in a Word 2003/2007 document and store the data in an MS-Access table. But, some Word documents have the data in structures like a table format but are not actually tables. The structure looks like a table, but the table borders are actually line connectors. These documents were created by a software(VeryPDF PDF to Word converter) which converted the PDF documents(the original format these documents were) into Word documents. 1. Is there a way I can convert/replace the tabular structures with actual tables in Word so t...

Select all of a certain column across multiple worksheets
Is there an easy way to simultaneously select (or do a find-and-replace) on column H on every worksheet of an entire multi-sheet workbook, without having to select that column on each individual worksheet by hand? Charles Belov SFMTA Webmaster http://www.sfmta.com/webmaster Right-click on first sheet tab and "Select all sheets" In activesheet select the column............will be selected on all sheets. Gord Dibben MS Excel MVP On Mon, 24 Aug 2009 16:43:02 -0700, "Charles Belov" <invalid@invalid.invalid> wrote: >Is there an easy way to simultaneously se...

Trying to create an Update query based on HR data to find upline V
Hi All, looking for some advice. I have an HR table that contains employee information but does not contain management chain info. Basically i am trying to determine who the employees upline VP is. The fields i have to work with are [Employee Name], [Manager Name] and [Job Title]. I figure the logic would be to check the employees' manager and if the manager is a VP (based on job title), return the manager's name to a field called [VP]. If the manager is not a VP then check that manager's manager, so on and so forth until a VP is found. Any ideas would be much appr...

"the wizard is unable to open your query in datasheet mode, possi
"the wizard is unable to open your query in datasheet mode, possibly because another user has a source table open in exclusive mode. your query will be opened in design view" what this message mean ,and how can i solve it Hi - Please provide more details as to what you are doing when you get the error, what your database setup is (i.e. split Fe/BE?, multiuser?, version? etc). Without more information, we can only guess. Thanks - John amr wrote: >"the wizard is unable to open your query in datasheet mode, possibly because >another user has a ...

Vb.net 2008 ContextMenuStrip logical error when running code
Greetings, I have a connectmenustrip item that when clicked runs the following code (see below) Now if the event is called by the button i.e. cmdDeleteingBooking.Click the linq query returns the appropriate value. However when called by cntMnuCancelBookingItem.Click is returns 0 even if a checkbox is of 'TRUE' value. Debugging shows the code runs exactly the same code (which loops around rows in a datagridview checking if the checkbox has been checked). Could someone explain the reasoning why the same code would return different results? Private Sub cmdDelete...

Sumproduct with multiple date criteria
Having a tough time with this one. Sheet 1 Column A = Start Date, Column B = End Date, Column C = Quantity. Sheet 2 Row A = Start Date, Row B = End Date. I would like Row C to sum quantity from sheet 1 where ever the two date ranges intersect. The date ranges on sheet 2 represent the beginning and ending of a week (Mon-Sun). Sheet 1 Column A Column B Column C 01JAN2010 24JAN2010 1,000 Sheet 2 Row A 04JAN2010 11JAN2010 18JAN2010 25JAN2010 Row B 10JAN2010 17JAN2010 24JAN2010 31JAN2010 Row c 1,000 1,000 1,000 0 Do the Sheet 2 Star...

Insert,Update Data in sage (MS Access Linked tables) using Vb.net form
Hi folks, I am developing application using vb.net which requires integration with SAGE LINE 50 (Accounting software ) V11... The data which SAGE is using is MC ACCESS 2003 database... with linked tables in it... Now I Have developed the Sage connection using ODBC which works fine when reading the record but cannot Add or Update record into the Linked tables.... When i debug the program the error is at the line where it has... <br> MyodbcCommand.ExecutenonQuery() <br> Can anybody Help ????? -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/acce...

"x" button enables deletion.... can we put a focus trigger there?
Hi, on three forms, I put focus triggers on the "delete" button because I need to validate some additional data before allowing the user to delete. However, if the user clicks on the corner "x" button to close the form and gets the dialogue box saying they have changes, do they want to "Save", "Delete" or "Cancel", they can delete the record anyways. Is there any way to put a focus trigger on the button of the dialogue box, or on the "x" button? Thanks in advance. I assume you are working with Dexterity. To work with an add...

Using atl based win dll with CString functions from the mfc projec #3
I have atl based general windows dll with class which contains functions which uses CString as parameters or return values. This dll might be used from the atl or mfc project. Dll can be used from ATL project without problems but whenever I try to use this class from the MFC project I get the following linker errors: error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __thiscall MyClass::AddMenu(long,class ATL::CStringT<wchar_t,class StrTraitMFC_DLL<wchar_t,class ATL::ChTraitsCRT<wchar_t> > > const &,long)" ... If I replace CStri...

Querying multiple records in two tables
Hi, in my database I have tables for users (UserID, UserName), projects (ProjectID, Project Name), and qualifications (QualID, QualName). I have join tables for users_qualifications (UserID, QualID), and projects_qualifications. (ProjectID, QualID). What I need to do is run a query for a project to show which users have the exact matching qualificiations. Users can have many qualifications, projects can require many qualifications, users may only work on a project if the qualifications required/held match exactly. Please help. Assuming that ProjID, and QualID are numeric, the following sho...

Not using zeros in graphing.
I have a running workbook that has tons of information. I have added a sum page in order to have all the data summed up in one simple place. I have formulas that read back into the workbook to link to a cell. Depending on what moth it is, that cell could be empty as it is a yearly wookbook. For example, if this is August, then there is information in the workbook up to August, but none after. With that said, the sum page has the #DIV/0! in the cell which essentially equals zero. I also have graphs that I have linked to this sum page. My problem is in order to keep the graphs up to...

using vba so search multiple Sheets
i'm trying to search across multiple sheets based on data submitted via an input box. So essentially, you click the button, a box appears, you type what your looking for and if it finds it, it'll select it otherwise a error message appeats. i found the below code, but it only works if the cell with the value in it is active (i.e. i've clicked on it). Code: Dim datatoFind Dim sheetCount As Integer Dim counter As Integer Dim currentSheet As Integer On Error Resume Next currentSheet = ActiveSheet.Index datatoFind = InputBox("Please enter the value to search...

Excel Running Wild After Update
I ran the Office update via Auto Update. Word and Powerpoint seem fine but Excel attemtps to open every compatible file (and a few that aren't) when I start it up. After it overdoses on files it fails and closes. Any ideas on what to do other than reverting to an older version, pre-update? Wild guess: Look in Applications:Microsoft Office 2004:Office:Startup:Excel: . Are there a bunch of random files in there? I think Excel would try to open anything in there on launch. On 3/23/06 9:04 AM, "Jeff Fread" wrote: > I ran the Office update via Auto Update. Word and Powe...

Can I do this query in one step?
Suppose I have a talble like this, each record has a unique ID. All"A"s or "B", "C"s should have only x or y or z property attached. Iwant to find A, B or C which has more than one properties.1 A x ...2 A x ...3 A x ...4 A y ...5 B x6 B y7 C z....resutls would look like:A xA y....I think I can do this in two steps or with a subquery. Then I thoughtof self-join but didn't figure out how to use it in this case.Thanks a lot! SELECT DISTINCT and do not include the record ID perhaps? Or is the record ID vital?"muster" <muster@gmail.com> wrote in me...

Single keystroke issue
Since upgrading from IE7 to IE8, I have lost the capability in the right-click menu to hhit a single key to perform a function. For example, right click a "favorite" and hit "m" to rename, or hit "d" to delete. Instead, now have to mouse over the command to perform. Also, the shortcut keyletter used to be underlined in IE7, now nothing underlined. I'm sure it is something simple, but I haven't been able to find the answer yet. TIA FerretDaddy & the FBR-Gang Hi Ferret, They changed the way the Favorites Pane and Links toolb...

Run series of query -- I don't want any pop-up
I have generated 4 queries (1. empty all, 2. import data, 3. generate information, 4. Make a new table) I've created a button to run these 4 quries sequencially. ------------------------------------------------------------------------------------ Problem: MS ACCESS pops up "confirmation dialog" to ask me whether to delete/modify the table. ------------------------------------------------------------------------------------ Question: I don't want any question to be asked. I just want those queries to be executed once i press my button. -------------------------------...

Next button problems
I have a next button in a form that I have criteria for. I have a date field that has to be entered before going to another record. When I click the next button I get the pop up that says click update to continue but the form displays the next record instead of staying on the current record that needs updating. Here is the code that I am using. ____________________________________________________________________________________ Private Sub Command39_Click() If IsNull([Post Called Customer]) Then MsgBox "You must click the UPDATE button to continue!!!" Cancel = True End If On Erro...

Use a VBA Macro inside an Excel Cell
This is a multi-part message in MIME format. ------=_NextPart_000_02B7_01C9F6B9.C9F418D0 Content-Type: text/plain; charset="windows-1255" Content-Transfer-Encoding: quoted-printable its been helpful to me so maybe it will do good for you too: how to create a simple macro within Microsoft Excel, and then how to use = that macro to calculate a single cell value. http://sysudi.blogspot.com/2009/06/use-vba-macro-inside-excel-cell.html ------=_NextPart_000_02B7_01C9F6B9.C9F418D0 Content-Type: text/html; charset="windows-1255" Content-Transfer-Encoding: quoted-printable &l...

DPM and VMM on same server using side-by-side SQL installation
Windows 2008 Std R2 Server, 64bit VMM 2007 is currently installed (with the built-in default database) SQL 2005 Express Edition, SP3, 32bit. I was advised by Microsoft that both VMM and DPM could be installed on the same server (small DR environment) The VMs are hosted on a Windows 2008 Enterprise Server w/ VS2005R2 - because the hardware didn't support HyperV. VMM works great to manage the Windows 2008 VS2005R2 Host running Win2K3 server instances ... after lots of trial and error. Now, I need to install DPM 2007 onto the same server... DPM wants to install the 64bit vers...

Using "fixed" decimal place function data for charts
Is there a way to graph data which utilizes the "fixed" function for decimal places? When I try this it will not graph, as the data has become text or something - even though I've selected number in the cell formats. If you've fixed the number of digits using only number formats, the values remain numeric, and they should chart just fine. This means selecting the range, going to the Formatting menu and selecting Cells, and on the Number tab, selecting Number in the category list, and setting a number of digits. I'm not familiar with a "fixed function". I...

How do I print a SINGLE POSTCARD on 5.5x4.25in stock?
I have a preprinted postcard that is 5.5" x 4.25". A standard postcard. I cannot for the life of me to get Publisher to print on this cardstock!! It keeps thinking the page is "LETTER 8.5x11". I have NO problems getting 4 cards (multiple addresses) to print on one page. But now I have the cards pre-printed and just want to mail-merge an address list onto them. How do I set this up? Because apparently, using the post card template of 5.5x4.25 (or even the 6x4) doesn't do it!!!!! Thanks for any insight. Jeff Jeff, File, PRINT SETUP Here select your stock si...

slow sync with Calendar using Kyocera 7135 via Outlook 2003
I'm stuck and need help. I have a Two Day Old Brand New Dell Dimension 4600. Does anyone out there know what to do when Outlook 2003 is giving a Log report that reads that Outlook Calendar - Slow Sync synchronization failed? This is a first time occurence for me. Outlook also reported that a device is trying to get access to my E- Mail addresses which may indicate a Virus may be present. I've run my McAfee Virus Protection and it didn't detrect anything. I'm at my wits end and don't know what else to do. Can anybody help? ...