Running diferent query with one command

I would like to run queries with just one botton and a date dispalyed in a
form.
If Sunday March 09, 2008, is dispalyed I would like to click on a button and
run a query that will select emloyees that are scheduled to work on this day
of the week along with other pertinent information already preselected by
that query.
Currenlty I am using 7 diferrent buttons to run 7 differnrent append queries
but it is too confusing and I am sure there is an better way.

Thanks

Charles

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200803/1

0
Charles
3/15/2008 12:26:56 AM
access.queries 6343 articles. 1 followers. Follow

8 Replies
1086 Views

Similar Articles

[PageSpeed] 23

Why 7 buttons and how is "a date displayed in a form"? How about providing 
some background about what you want to do and what you are currently doing?
-- 
Duane Hookom
Microsoft Access MVP


"Charles via AccessMonster.com" wrote:

> I would like to run queries with just one botton and a date dispalyed in a
> form.
> If Sunday March 09, 2008, is dispalyed I would like to click on a button and
> run a query that will select emloyees that are scheduled to work on this day
> of the week along with other pertinent information already preselected by
> that query.
> Currenlty I am using 7 diferrent buttons to run 7 differnrent append queries
> but it is too confusing and I am sure there is an better way.
> 
> Thanks
> 
> Charles
> 
> -- 
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200803/1
> 
> 
0
Utf
3/15/2008 2:00:03 AM
Thanks for the quick follow up.
I have a table with all assignments. 7 days. "Sunday" "StartSun" "EndSun" I
have this for all seven days, Under the day of the week is the shift number
and employees may work a different shift each day with it's corrensponding
times. Presently I run a query for each day to generate a report listing
employees scheduled to work, shift number and times. This is also linked to a
work order system and it workls well I just want to simplify the assignment
part by running the query just by identifying the weekday by the date, the
date is entered by a pop up calender in the front form and I link the various
queries by using the following in the criteria or when I append the
information to the a master table storing all previous assignments "Forms!
[Operation]![TripDate] The queries add the assignments to a master table were
all records are stored and then I run query to generate the report t by using
the date the criteria or filter. 

Thanks

Duane Hookom wrote:
>Why 7 buttons and how is "a date displayed in a form"? How about providing 
>some background about what you want to do and what you are currently doing?
>> I would like to run queries with just one botton and a date dispalyed in a
>> form.
>[quoted text clipped - 8 lines]
>> 
>> Charles

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200803/1

0
Charles
3/15/2008 3:30:10 AM
I'm sorry but I don't understand anything about your tables, data, or what 
you are trying to accomplish. Could you share some table designs as well as 
sample data and desired outcome?
-- 
Duane Hookom
Microsoft Access MVP


"Charles via AccessMonster.com" wrote:

> Thanks for the quick follow up.
> I have a table with all assignments. 7 days. "Sunday" "StartSun" "EndSun" I
> have this for all seven days, Under the day of the week is the shift number
> and employees may work a different shift each day with it's corrensponding
> times. Presently I run a query for each day to generate a report listing
> employees scheduled to work, shift number and times. This is also linked to a
> work order system and it workls well I just want to simplify the assignment
> part by running the query just by identifying the weekday by the date, the
> date is entered by a pop up calender in the front form and I link the various
> queries by using the following in the criteria or when I append the
> information to the a master table storing all previous assignments "Forms!
> [Operation]![TripDate] The queries add the assignments to a master table were
> all records are stored and then I run query to generate the report t by using
> the date the criteria or filter. 
> 
> Thanks
> 
> Duane Hookom wrote:
> >Why 7 buttons and how is "a date displayed in a form"? How about providing 
> >some background about what you want to do and what you are currently doing?
> >> I would like to run queries with just one botton and a date dispalyed in a
> >> form.
> >[quoted text clipped - 8 lines]
> >> 
> >> Charles
> 
> -- 
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200803/1
> 
> 
0
Utf
3/15/2008 5:17:01 AM
I will give it a try

ShiftTable: 
 ID#         Shift#:      RDO:      Sunday:  StartSun:  EndSun:  Monday:
StartMon: EndMon: Etc.
12345       001           WT           120        6:35           14:05    125
7:20       3:30   

Name Table:
ID#:         NameL:         NameF :   and other employees information in 12
fields;
12345      Jones             Doe
On Sunday select ID Sunday Shift and times and   RDO
Query result will look like this. Sorry I dont know how to use SQL

Forms![Operation]![TripDate]: 03/10/08 ID#: 12345  Shift:001  RDO: 120
Sunday: 120  StartSun: 6:35  EndSun 14:05

Each day I use a different uppend query for the above information and create
a master table that will store this information and run reports on who warked
what or who is scheduled to work  selected by date. I use 7 different buttons
in the operation  form where also the date is displayed.

Charles

Duane Hookom wrote:
>I'm sorry but I don't understand anything about your tables, data, or what 
>you are trying to accomplish. Could you share some table designs as well as 
>sample data and desired outcome?
>> Thanks for the quick follow up.
>> I have a table with all assignments. 7 days. "Sunday" "StartSun" "EndSun" I
>[quoted text clipped - 20 lines]
>> >> 
>> >> Charles

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200803/1

0
Charles
3/15/2008 1:02:36 PM
IMHO I wouldn't spend much time with this table structure. Rather than 7 sets 
of repeating fields, I would create a table that would store this information 
in 7 records. 

You don't have to "know how to use SQL". You can use the query designer to 
build your queries and then switch to the SQL view so you can provide us with 
the SQL statement.

BTW: what does RDO mean? What type of values are you storing in the Sunday 
and Monday fields?
-- 
Duane Hookom
Microsoft Access MVP


"Charles via AccessMonster.com" wrote:

> I will give it a try
> 
> ShiftTable: 
>  ID#         Shift#:      RDO:      Sunday:  StartSun:  EndSun:  Monday:
> StartMon: EndMon: Etc.
> 12345       001           WT           120        6:35           14:05    125
> 7:20       3:30   
> 
> Name Table:
> ID#:         NameL:         NameF :   and other employees information in 12
> fields;
> 12345      Jones             Doe
> On Sunday select ID Sunday Shift and times and   RDO
> Query result will look like this. Sorry I dont know how to use SQL
> 
> Forms![Operation]![TripDate]: 03/10/08 ID#: 12345  Shift:001  RDO: 120
> Sunday: 120  StartSun: 6:35  EndSun 14:05
> 
> Each day I use a different uppend query for the above information and create
> a master table that will store this information and run reports on who warked
> what or who is scheduled to work  selected by date. I use 7 different buttons
> in the operation  form where also the date is displayed.
> 
> Charles
> 
> Duane Hookom wrote:
> >I'm sorry but I don't understand anything about your tables, data, or what 
> >you are trying to accomplish. Could you share some table designs as well as 
> >sample data and desired outcome?
> >> Thanks for the quick follow up.
> >> I have a table with all assignments. 7 days. "Sunday" "StartSun" "EndSun" I
> >[quoted text clipped - 20 lines]
> >> >> 
> >> >> Charles
> 
> -- 
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200803/1
> 
> 
0
Utf
3/15/2008 6:59:03 PM
The purpose for the first query is a simle way to combine last and first
names and used by many other reports.

SELECT Names.ID, [Last] & ',' & ' ' & [First] AS Names1, [First] & ' ' &
[Last] AS [Names], Names.License, Names.DOB, Names.Title, Names.Last, Names.
First, Names.[Seniority #], Names.DOH, [City] & ',' & ' ' & [State] & ' ' &
[Zip] AS AddrComb, Names.Address, Names.City, Names.State, Names.Zip, Names.
Status, Names.LicenseExpire, Names.Phone
FROM [Names];

RDO is an acronym for regular day off. Under the day of the week is the work
assignment number for that day and it may vary on some day. when an employee
is not scheduled then the field will state Off. The status fileld is for
other information that may include unscheduled time off such as sick, holiday,
personal day, vacation or a simple message to the employee "see GM"


INSERT INTO AssignmentsAll ( Seniority, Name, Status, DriverID, RDO,
StartTime, Block, EndTime, ScPayHrs, SDate )
SELECT NameComb.[Seniority #], NameComb.Names1, NameComb.Status, Assignments.
ID, Assignments.RDO, Assignments.MoStart, Assignments.Monday, Assignments.
MoEnd, Assignments.Hours, Forms!Operation!TripDate AS Expr1
FROM NameComb RIGHT JOIN Assignments ON NameComb.ID = Assignments.ID
ORDER BY Assignments.MoStart, Assignments.Monday;
Presently I run 7 queries (one each day) and I wonder if it can be done with
one or one command button based on the day of the week or date.

Thanks

Charles


Duane Hookom wrote:
>IMHO I wouldn't spend much time with this table structure. Rather than 7 sets 
>of repeating fields, I would create a table that would store this information 
>in 7 records. 
>
>You don't have to "know how to use SQL". You can use the query designer to 
>build your queries and then switch to the SQL view so you can provide us with 
>the SQL statement.
>
>BTW: what does RDO mean? What type of values are you storing in the Sunday 
>and Monday fields?
>> I will give it a try
>> 
>[quoted text clipped - 29 lines]
>> >> >> 
>> >> >> Charles

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200803/1

0
Charles
3/16/2008 12:03:00 AM
As I stated earlier, I would normalize the Shift table or use a union query 
to normalize it. You can then use a single append query.

-- 
Duane Hookom
Microsoft Access MVP


"Charles via AccessMonster.com" wrote:

> The purpose for the first query is a simle way to combine last and first
> names and used by many other reports.
> 
> SELECT Names.ID, [Last] & ',' & ' ' & [First] AS Names1, [First] & ' ' &
> [Last] AS [Names], Names.License, Names.DOB, Names.Title, Names.Last, Names.
> First, Names.[Seniority #], Names.DOH, [City] & ',' & ' ' & [State] & ' ' &
> [Zip] AS AddrComb, Names.Address, Names.City, Names.State, Names.Zip, Names.
> Status, Names.LicenseExpire, Names.Phone
> FROM [Names];
> 
> RDO is an acronym for regular day off. Under the day of the week is the work
> assignment number for that day and it may vary on some day. when an employee
> is not scheduled then the field will state Off. The status fileld is for
> other information that may include unscheduled time off such as sick, holiday,
> personal day, vacation or a simple message to the employee "see GM"
> 
> 
> INSERT INTO AssignmentsAll ( Seniority, Name, Status, DriverID, RDO,
> StartTime, Block, EndTime, ScPayHrs, SDate )
> SELECT NameComb.[Seniority #], NameComb.Names1, NameComb.Status, Assignments.
> ID, Assignments.RDO, Assignments.MoStart, Assignments.Monday, Assignments.
> MoEnd, Assignments.Hours, Forms!Operation!TripDate AS Expr1
> FROM NameComb RIGHT JOIN Assignments ON NameComb.ID = Assignments.ID
> ORDER BY Assignments.MoStart, Assignments.Monday;
> Presently I run 7 queries (one each day) and I wonder if it can be done with
> one or one command button based on the day of the week or date.
> 
> Thanks
> 
> Charles
> 
> 
> Duane Hookom wrote:
> >IMHO I wouldn't spend much time with this table structure. Rather than 7 sets 
> >of repeating fields, I would create a table that would store this information 
> >in 7 records. 
> >
> >You don't have to "know how to use SQL". You can use the query designer to 
> >build your queries and then switch to the SQL view so you can provide us with 
> >the SQL statement.
> >
> >BTW: what does RDO mean? What type of values are you storing in the Sunday 
> >and Monday fields?
> >> I will give it a try
> >> 
> >[quoted text clipped - 29 lines]
> >> >> >> 
> >> >> >> Charles
> 
> -- 
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200803/1
> 
> 
0
Utf
3/16/2008 3:08:00 AM
I will give that a shot 

Thank you very much

Charles

Duane Hookom wrote:
>As I stated earlier, I would normalize the Shift table or use a union query 
>to normalize it. You can then use a single append query.
>
>> The purpose for the first query is a simle way to combine last and first
>> names and used by many other reports.
>[quoted text clipped - 41 lines]
>> >> >> >> 
>> >> >> >> Charles

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200803/1

0
quinto
3/16/2008 3:30:04 AM
Reply:

Similar Artilces:

Need only one DLL instance to run...
Hi all, 1: if two apps load the same DLL - LoadLibrary(...) - system will create to different instance of the DLL... Now, in my DLL i've a CList and i need it to be visible to all instance and all apps!!!! Is there a way!? 2: I need the dll to remain loaded till machine reboot!!! Is it possible!? Thanks Ale >if two apps load the same DLL - LoadLibrary(...) - system will create to >different instance of the DLL... >Now, in my DLL i've a CList and i need it to be visible to all instance and >all apps!!!! > >Is there a way!? It'll be difficult to share a ...

multiple worksheets in html
I want to create a workbook with multiple worksheets in html format. This is easy to do by creating one file per sheet and loading each into my workbook using '<x:WorksheetSource HRef="filename"/>'. This, however, results in 3+ files for 2 worksheets. I would like to put all of the data in one file. Is this possible? thanks, -mikael ...

Present Value of One Time Payment N Years in Future
How do you calculate the present value of a one time payment that is N years in the future? -- Will On Jun 10, 9:23 pm, "Will" <westes-...@noemail.nospam> wrote: > How do you calculate the present value of a one time payment that is N years > in the future? Suppose the future value is $100,000 in 20 years. You need to know the annual "rate" -- an interest rate, average growth rate, or a discount rate. Suppose it is 5%. Then the present value is: =pv(5%, 20, 0, -100000) I am a newbee to 2007 and have lost the function of saving a *.dbf file back to a...

easy way around "not updateable query" for sums?
I have a table. I am trying to update that table based on a query. The query involved used sums. When I try to this, I get "this is not an updatable query." I know the cause for it, the fact that the query has sums. I also know the way around it. Run my query as a make table query, then build my update query from that. This project would have me doing this a couple of dozen times. I really do not want to build 24 make table queries, 24 update queries, and then have to delete those 24 tables. If nothing else, I would expect that would seriously fragment my databse,...

credentials to run this report are not stored
Hi all, I'm getting this problem when I try and create a timed subscription. Error: ...credentials to run this report are not stored..... ok I created another folder under the same folder where I'm having this problem. loaded the report and I have no problem. I even moved the current folder with that report in it. Creted another folder with the same name and still the same problem with that named folder. With a different name for the folder I have no problem??? I'm stuck here.. almost all post just talk about storing the credentials, Already done and works...

run time error 10-22-03
I am having a lot of trouble when I open up word I get run time error 52 in VB. I have tried uninstalling word and reinstalling it. WE have tried deleting the macro but still to no avail can someone help me please? ...

Repost: Error running Report in an Access 2003 db from Access 2007
Ok, clarification - ignore the code from my original post, some of the reports do work. The ones that don't are reports that I have being filtered. Here is the code from one of those buttons: Private Sub Ok_Click() On Error GoTo Ok_Click_Err 'using the customer sub form for customer state report to filter the report, clicking ok will open report for selected state Dim stDocName As String Dim stLinkCriteria As String If Not IsNull(Me.Search_Results) Then stLinkCriteria = "[StateOrProvince] = """ & Me![Search Results] & """"...

Query Exchange/AD for users that have OWA enabled
Does anyone know if there is a query that I can run to give me a list of all user accounts that have the OWA feature enabled? We have 900 accounts, and we only allow some user "types" to have OWA access... We are running Exchange 2003 on Win2003 server, Active Directory, etc. Please forgive me if I am posting to the incorrect group (Exchange instead of AD?) Thanks. Donna ...

Automatically run macro
My name is Mike and i have a question about microsoft excel macro's. Attached is a copy of the excel sheet im working on. Below the excel sheet is the macro I built. Some of the cells contain given values and some cells are calculated from formulas. Cell (G4) is my given value...it is related to cell (C32). The point is, I plug a value into cell (C10) and it runs through the rest of the calcs in the other cells and gives me a value to cell (C32). I built a macro that works as a goal seek pretty much. The macro makes cell (C32) equal to cell (G4) and gives me the value for cell (C10). I wan...

Excel Continuous Running Total
I posted a message earlier and have received a partial solution. I want to keep track of how much stock prices go up or down with a running total of how much they go up or down over several days until the direction changes. For example, if price go up 10 on Mon, 20 on Tues, 30 on Thurs and down 10 on Fri I want my running total column to show a positive number of 60 and then a red number of 10 and continue adding the amount of the total of the down days until the market shows an up day. The formula I am now using total the first and second day but does not do a running total count if t...

display changing label caption on form as sub runs w/o screen flic
let's say i have this routine Sub Test label1.caption = "Starting ... " 'do events label1.caption = "Getting there ... " 'do events label1.caption = "Finished! ... " End Sub on my form, i have label1 right in the middle what happens is sometimes the message will change, and then sometimes it wont, or it will show the first one, skip the second and jump to the third etc etc etc so it is inconsistent. is there a way to make sure the label caption displays consistently, on time, wh...

Locate a cell, based on a criteria, then use the 'Cell' command...
I am using a pivot table to configure some data. In the first column, the pivot table of course displays only one instance of the text representing of data group. What I need to do is determine in which cell a particular item of text (i.e. the criteria) resides in. Once I can locate the cell where my 'criteria' text string resides, I can then use the CELL function to return the row number. My question is... what excel formula can I use to locate a cell in a single column range, where the cell contains the text = "XYZ" My eventual plan is to then use the following ...

Create a custom footer for all Excel worksheets at one time...
I want to create a custom footer, just once, that could be applied to all worksheets in an Excel workbook. Microsoft Word lets you do this, so why not Microsoft Excel? BigCat Try the code below: Be sure to substitute the information for what you want. HTH Dennis ******************************************** Sub PageSetupAllSheets() Dim EachSheet As Worksheet For Each EachSheet In ActiveWorkbook.Worksheets With EachSheet.PageSetup ' &F = File ' &A = Tab ' &D = Date ' &T = Time ' &P = Page ' &N = Pag...

Access97 Queries connecting via ODBC to Sybase SQLanywhere backend
I have a Access97 frontend database and it links tables and queries to a Sybase SQLAnywhere backend database. I have imported all the tables from the SQLAnywhere into a Access97 database. I have changed the linked relationship in the tables section to point to the Access97 backend now and not the Sybase backend. Problem is I have SQL queries written in the Access 97 frontend that still try to access Sybase via ODBC. How do I change these queries to access the new Backend. Jamie Network Administrator If the queries were originally written using linked tables, they should still work. Ho...

when I try to bullet one line, all bullets for every line
When I type a paragraph and want to indent with a bullet., the entire paragraph is automatically bulleted and goes to a single spacing. I tried turning off bullet in the options but it still doesn't work. I repaired Office and it still does the same thing. ...

Get query from Access
Hello, trying to do a query. So I do the following: Data->get external data->New database query, then from the Choose Data source, I choose MS 97 ACCESS DATABASE*, then I select the database. This brings me to the QUERY wizard-Choose columns When I double click on the table/query I want, it doesn't bring the columns to choose. It changes the + sign to - sign but nothing else. I try a different database, and on this one it does work. So not sure why only on one database it works. Any suggestions? Would appreciate it. thanks, Juan ...

Money 2002 will not run
I had been using Money 2002 for approx. 3 yrs on my home pc (Dell Dim 2100, XP Home Ed. w/SP2). Last year, it simply would not launch. No error message, no splash screen, no app opening, no process listed in Task Manager. Just.... nothing.... The only change that was made to the system since M2k2 last ran was upgrading my a/v solution from Trend Micro PC-Cillin to TM Internet Security. I have tried disabling every aspect of the Internet Security product, as well as completely un-installing the app, and then attempting to run Money, but the same thing (nothing) happens. I was considerin...

Re: Workflow just wont run automatically, i have to run them manually
Yes, but i realized what i was doing wrong. I assumed [bad idea] that if i create a case and hit Save & Close the first time, taht the rule will run. In order for the rule to run automatically, it has to be Save, once it saves it, then Save & Close. Thanks for your reply. "Hi, Did you check the workflow monitor to see if the rules get triggered correctly and complete sucessfully ? Have a nice day, St=E9phane Dorrekens " --------------= Posted using GrabIt =---------------- ------= Binary Usenet downloading made easy =--------- -= Get GrabIt for free from http://...

Outlook Still Running
I am running XP Pro with Office 2003 Pro and sometimes when I exit out of Outlook, Outlook.exe and Winword.exe stay as processes still running. Does anyone else have this problem and what can do to make sure this does not happen? Thanks for your help -- Neil Remove ABCD from Email address to reply <neil154ABCD@earthlink.net> wrote: > I am running XP Pro with Office 2003 Pro and sometimes when I exit > out of Outlook, Outlook.exe and Winword.exe stay as processes still > running. Does anyone else have this problem and what can do to make > sure this does not happ...

combo box in a query
Hi, Is it possible, do you think, to insert a combo box into the criteria section of a query? The user of the query will have a lot of units to choose from in the query and it would be easier for the user to have a drop down box to make a selection from. Can this be inserted into the query so that it appears and is functional when the query is run? If so...how would a novice go about it? Thanks, Regards, oic3120 Not directly, but you can enter a reference to a combo box as a parameter in the query. Create an unbound form with a combo box on it which lists all the possible values in o...

Very strange problems while running Great Plains on workstations
I notice that a few workstations in an office I support are having problems when they run Great Plains. Excel, Outlook, Word and Dynamics.exe are showing in the Application event log as being Hanging or Faulting. I also see Fault Bucket errors, but when I search online I cannot find any information online. Here is one of the Fault Bucket errors: 3:15:35 pm 28-Sep-06 Application Hang None 1001 N/A Fault bucket 296734104. Also, these workstations are experiencing problems printing PDF files. Has anyone out there seen this behavior and if so, how can these problems be fixed? Thank you, ...

Publisher 2000 will not run
I had problems with Publisher 98 not running which we=20 never did solve so I installed office 2000 to see if=20 Publisher 2000 would function. Same problem: The flash=20 screen pops up and then disappears. No program. Microsoft=AE Publisher 2000 Version 6.0 has encountered a=20 problem and needs to close. We are sorry for the=20 inconvenience. Howard, hi again, Have you tried opening Publisher in safe mode? Publisher retains all printer information within its publications. If you can open Publisher in safe mode, either regress or update your printer and video drivers. -- Mary Sauer MS MV...

appear values of two periods insted of one
Dear All There is any possibility to have in a cylinder chart type the values above the cylinder i.e for period 2003 and above this titles to bring in a brackets only the values of another period 2002 for example. But to have only the bars of 2003? I am using excel xp version thanks in advance manos Hi manos, The simple way to do this is to store the required data label text in a cell and then link the labels to those cells. Use Rob Bovey's free addin to make linking labels to cells easier. http://www.appspro.com/Utilities/ChartLabeler.htm manos wrote: > Dear All > > ...

Macro automatic run at open
Is there a simple way to have a macro automatically started when a workbook is open? Thanks Francesco Francesco, use the workbook open event, like this, Private Sub Workbook_Open() MsgBox "It Works!" End Sub To put in this macro, from your workbook right-click the workbook's icon and pick View Code. This icon is at the top-left of the spreadsheet this will open the VBA editor to the thisworkbook module, then, paste the code in the window that opens on the right hand side, press Alt and Q to close this window and go back to your workbook, now this will run every time you ...

How do I create very small graphics in ONE cell?
I have data like following and I want to creat a line or 3 bars to reflect the numbers in ONE cell so that people can quicky scan through the trend. 3,225 2,356 1,087 I tried wizard but it doesn't look good when you minimize it. I tried autoshape but couldn't let the ahotopshap connect to the numbers. My boss said he has seen people do this before. Does anyone know how to do it? Thanks! There's a couple of ways to go. The first is to adapt the idea behind Using Worksheet Cells to simulate a graph http://www.tushar- mehta.com/excel/newsgroups/worksheet_as_chart...