How Can I Have A Listbox Let Users Choose What Query To Run?
Jan 6, 2008
I want to have users be able to choose query "x" "y" or "z" from a listbox. Upon selection of query "x" "y" or "z" from the listbox, I want the query to run? I want to run this query from form "RunQueries" Does anyone know how I can do this? Thank you in advance for any suggestions, I appreciate all the help I can get
View Replies
ADVERTISEMENT
Sep 3, 2004
Hi,
I'm trying to create a pop up form that asks userto select months for a report to preview. I've writtent he query and done the report. I can do the command button to get the selectmonth form to pop up, but not sure how I pass the selected months into query for the reports. Any tutorials on this or can someone help. I've been looking around but nothing quite fits. Quite new VB also, but have a good understanding programming generally.
Thanks.
View 1 Replies
View Related
Feb 14, 2008
I'm new to MS Access but I'm trying to do subcontractors database for my company. I've got a menu form with to listboxes on it. First listbox is a subcontractor name if I choose the name the second list box will show me the names of the emplyess attached to this subcontractor. Second form is subcontractor details with emplyees subform. If I will dblclick subcontractor listbox it takes me to record with subcontractor but I can't figuret out how to do that if I dblclick the employee listbox it will take me to appropriet subcontractor detail and to wright employee details. PLEASE HELP ME. I'm strugling with this. Thanks
I've made it to set focus to subform, but if I will choose a subcontractor from the first listbox and dblclick on lstEmployee it is choose wrong record of the employee. Have somebody have an idea what I'm doing wrong
I don't know how to attach the file,can sombody tell me how.
Code of this listbox:
Private Sub lstEmployee_DblClick(Cancel As Integer)
DoCmd.OpenForm "Subcontractors", acNormal, "", "", , acNormal
DoCmd.GoToRecord , , acGoTo, Forms!Menu!lstSubcontractor
Forms!Subcontractors!tblEmployeesubform.SetFocus
Forms!Subcontractors!tblEmployeesubform.Form.Emplo yeeID.SetFocus
DoCmd.GoToRecord , , acGoTo, Forms!Menu.Form!lstEmployee
End Sub
I think last line makes me those troubles but I don't have an idea what is wrong.
View 1 Replies
View Related
Sep 15, 2004
Hello,
Does anyone know how to create a form with a listbox that lets u choose reports and preview or print at the click of a button. I know you can do it wil tables and queries but I need it to do it for reports.
Thanks
View 11 Replies
View Related
Jun 2, 2005
Hi,
I have a requirement to filter some queries periodically on the date field.
What I want to do is create a form that lets you choose which query to use and filter and not create alot of single forms.
The filter will be only be applied whilst the form is open.
Cheers
Gordon
View 3 Replies
View Related
Aug 24, 2005
I need to allow a user to select criteria as part of a query.
Running the query manually I would type in either:
"Core Stock"
OR
<>"Core Stock"
in the criteria field of the column.
I tried using the following parameter in the design grid:
Choose([Select 1: Core Stock 2: Not Core Stock : ],"Core Stock",<>"Core Stock")
The "Core Stock" option works but the <>"Core Stock" returns no records.
I would prefer not to use a form if possible . Any ideas ?
Regards
David
View 3 Replies
View Related
Oct 23, 2005
Hi
I would like to set up a query that uses two tables. One of the tables, the 'main table', wil be used every time the query is run. Each time a new record is created in the main table a 'new table' is created containing a subset of data - the name of this table uses a ref ID from the main table. I would like to be able to select which 'new table' to use in the query as part of a parameter query.
eg. Main table record 1 has a field JID of J0001 and a corresponding 'new table' titled J0001. record 2 in main table has JID J0002 and creates a 'new table' J0002 etc
so I would like to set the query up such that when a record is chosen in 'main table' the query knows the name of the 'new table' corresponds to the JID of the record in 'main table' ....
Have seen the same question asked but no answer - is this possible ?
any pointers appreciated..
View 4 Replies
View Related
Mar 2, 2007
Hello, i was wondering if you could help.
I want to run an update query, taht updates prices in a table. But i would like to be able to choose the criteria when the query runs, for example a message box appears, that will allow me to enter a certain amount for the prices to change by. Could someone guide me on how to do this? thankyou, its much appreciated
View 3 Replies
View Related
Sep 28, 2013
I have an option group that lists a variety of categories which I want to query on.
I know that the option group only returns values.
In the Option Group, On Time = 1, Over Due =2 ,,,,
I am using a Choose function in my query. That is working fine. But ... I would like to have a last choice called "All" such that when selected all data is shown (i.e., On Time, Over Due, ....).
I am using the following:
Choose ([optiongrpStatus],"On Time", "Over Due", .... ,???) as my query criteria.
Have not figured what I can put in the last choice to get all data.
Tried "Is Not Null", tried "On Time or Over Due" - know these don't make sense -just wanted to try.
View 7 Replies
View Related
Jun 6, 2007
Is it possible to have a form designate which FIELDS to include in a selection query? I know that I can determine criteria and such, but i want the user to be able to generate a report based on the query select a, b, c from blah, or if they wish, just select a, b from blah...
View 5 Replies
View Related
Apr 21, 2006
Hi, I'm new here, so I hope I'm posting this in the correct place. I've searched the forum to see if there are any existing threads that might help me, but I've not found anything that does...
(I think this thread ( http://www.access-programmers.co.uk/forums/showthread.php?t=93444&highlight=Copying+data )may be trying to achieve something similar to me, but I'm a beginner and don't really understand it)
I shall stop waffling! I'm not entirely sure that what I'm trying to achieve is possible, I expect it probably is!
Right, I have a form (frmGroupRegister, which contains exactly the same fields as the table it comes from, tblGroupRegister), which consists of three things:
-GroupDate - The date a group took place on. It is my primary key, as no more than one group occurs on a specific date.
-ParentList (A listbox which contains a query showing the ID number, forename and surname of everyone in a table, tblParentDetails)
-ParentsAttending (A blank listbox)
I would like to place buttons in between the ParentList and ParentsAttending, which would allow users to conduct a 'register' of attendance by copying individual/multiple details from ParentList into ParentsAttending (much like you get when choosing which fields to include in a form when using a wizard for example). I would also like them to be able to remove people from ParentsAttending by using a button in case of accidentally adding the wrong person into the ParentsAttending box.
I'm aware that another, probably simpler way of achieving this would be to use a tick-box system, but I feel that visually, the first method would both look better and demonstrate who is present more clearly.
Any help would be much appreciated, but my Access skills are quite basic and things will probably need to be spelled out for me.
I'm using Access 2000 and Windows XP.
Thanks for your help,
Alice :)
View 1 Replies
View Related
Feb 21, 2006
Hi,
I have a table of users somthing like this:
User_ID
Name
Hobby
Favorite_Food
Blah
Blah
Blah
Users can be friends with one another and I need some way of logging this.
My 2 options (that i can see) are:
1) Putting a friends entry in the main user table then comma delimiting the User_ID's in the friend entry like so:
User_ID: 001
Name: John
Hobby: Frizbee
Favorite_Food: Cake
Friends: 002,004,010
2) Making a seperate table with multiple entries for each user like so:
User: 001
Friend 002
---
User: 001
Friend: 004
---
User: 001
Friend: 010
---
User: 002
Friend: 001
---
User: 004
Friend: 001
---
User: 010
Friend: 001
---
The database has to be handled by a web service and/or a web appliction making the comma delimited option occupy more server time breaking down the string into usable user_ID's.
But (and this is probably my actual problem) if i was to impliment my second idea, I'm not sure what I should make the tables primary key or the best way to relate it to the main user table.
My initial thought is to just have a, technicaly useless, ID be the primary key and impliment a one(User) to many(friends entries) relationship... but im a bit of an access n00b so thought i better come ask for some advice.
Thanks.
View 1 Replies
View Related
Jul 19, 2005
I know SQL, and I know databases, but this has me confrused.
I describe it in terms of macros, but I get the same results if I manually execute the queries.
A client has an Access DB that is used by the 5 employees in the office. He has a macro that creates an interim user list, then compares it the the user list from the start of the month.
If he runs the macro to create the interim user list from his computer (computer 1) then any computer can run the other macro and get the differences (about 200 rows).
If any other computer creates the interim user list, then any computer that runs the macro to calculate differences gets invalid results (>3000 rows).
A union of the 'good' interim user list and 'bad' interim user list shows about 3000 rows (out of 4345 rows in each original table), so the macro produces 1345 differenct rows, depending which computer it is on.
I verified that each computer is opening the correct database, and the query is a moderately simple INSERT INTO ... SELECT FROM query.
Does anyone know why this might happen, and/or an easy way to determine which rows are different, and why? It is Access 2003 with SP1, everyone has the same version.
View 1 Replies
View Related
Aug 8, 2005
Hi,
Is there a way to automatically choose a value such as 0 if the expression goes to a negative number?
E.g. I have a query that will subtract a numeric field from 10. If 10 - [numericfield] is less than 0, then I only want it to display 0. Otherwise, it can display the value if it is positive.
Any help would be much appreciated.
View 3 Replies
View Related
Feb 19, 2008
Hi everyone,
I am looking for some help with a particular problem. I have a report based on a query and at the moment it is ordered by a particular column.
What I want to be able to happen is that the user chooses what they want the query (and subsequently) the report to be ordered by before they run the report by means of a combo box or something like that.
Is this possible in anyway?
Thanks.
Gareth.
View 3 Replies
View Related
Jun 19, 2015
I have a database where there are 3 tables. table "d_cases", table "d_user" and table "d_status"
The table "d_cases" has the users and statuses only with a number. Peter has ID 2, John ID 1. There is status ID 1 that is New, ID 2 Started and so on.
How can I run a query that will show me the names and status instead of the numbers?
I have attached the database (2003 format) ....
View 2 Replies
View Related
Apr 3, 2013
I have a form that I've created to allow users to do a ad-hoc query on data in a table. Most of the fields are setup as
Code:
Like [Forms]![Unusual Login Research]![CustomerName] & "*"
where I have a drop-down box with options for: >, <, >=, <= and between. I've tried a bunch of iterations of the same criteria and keep getting the error above. Just as a test, i was trying to at least get the between option to work with the following:
Code:
[Forms]![Unusual Login Research]![ScoreAtLoginCriteria]+" "+[Forms]![Unusual Login Research]![ScoreAtLogin1] And [Forms]![Unusual Login Research]![ScoreAtLogin2]
Where ScoreAtLoginCriteria is the drop-down, set to "between" and ScoreAtLogin1 and ScoreAtLogin2 are integers.
View 4 Replies
View Related
Aug 26, 2014
I am setting up an Access database for a small school. The database contains a record per person. When we get a duplicate lastname field we set a family_id field to lastname followed by a number.
So for example the first Smith family needs to family_id. But the second Smith family gets a family_id of smith1. To select an ordered list of Families I need a query that will use the family_id if it is set and if not use the the lastname to collect family members.
My query uses a presorted table, CurStuByGrdTbl , of current students to produce the families directory by grade and alphabetized.
The WellSchoolCommunityAll table is the entire database. So if the student entry has a valid family_id, matching pattern "*#" then
I perform a Like with family.id otherwise I perform a Like with lastname.
This query gets me nothing, no records.
IIf(([CurStuByGrdTbl].[family_id]="*#"),[CurStuByGrdTbl].[family_id] Like [WellSchoolCommunityAll].[family_id],[CurStuByGrdTbl].[lastname] Like [WellSchoolCommunityAll].[lastname])
View 4 Replies
View Related
Jun 10, 2015
I am using the selections made of the form to generate a query for the user.
I have a CITIES listbox that is populated with values from a stored query.
I would like to make it multi-select and populate a LOCATIONS list box and a NAMES list box based upon the CITIES that are selected.
I have the locations currently populated from a stored query that reads the City selection from the Form. It looks like this
Code:
SELECT DISTINCT (t_location.LOCATION) AS Expr1
FROM t_location INNER JOIN t_asset_master ON t_location.LOCATION_PHY_ID = t_asset_master.LOCATION
WHERE (((t_location.CITY)=[Forms]![MasterQueryGenerator]![CityList]));
I also want multi-select so that is you can un-select all and get the results for all cities.
Here is my half thought approach.
Code:
Private Sub CityList_AfterUpdate()
'Dim LocQryStr As String
'Dim r As Integer
'Dim ctl9 As Control
'LocQryStr = "SELECT DISTINCT (t_location.LOCATION) " & _
[Code] ...
I intended to have the variable LocQryStr as the row source but I abandoned the idea of having multi-select when I saw that .Selected(I) never returned true. Its like the values aren't read in this subroutine.
View 5 Replies
View Related
Sep 9, 2013
I have a list box called "product list box" based on a query called "searchqry", i also have another listbox called "type list box" , how do i get the type list box to only show "types" based on the section in products list box?
View 1 Replies
View Related
Jun 1, 2007
Hi,
I am building a database that calculates freight costs for shipments.
I have one table that has order data with fields such as [Order Number], [Origin], [Destination], [Service Level], [Weight].
The service level is one of 4 values: PRE 9, PRE 12, NEXT DAY, NEXT DAY +1.
The origin and destination use country codes such as BE, AT, CZ, PL for Belgium, Austria, Czech, and Poland respectively.
I also have rate sheets from carriers such as DHL and UPS and they provide their rates in the following format (numbers are made-up as real rates are confidential): [Origin], [Destination], [Service Level], [0 to 0.5 kg], [0.5 to 1.0kg], [1.0 to 1.5kg], [1.5 to 2.0kg], etc all the way up to 30kg. The rate is then in the appropriate column and the row gives the origin-destination-service level combination.
(sample freight rate table uploaded as zipped excel sheet in attachment)
I need to return the rate from the appropriate row based on the [Origin], [Destination] and [Service Level] fields (easy enough), which is easy enough.
The hard part is selecting the correct field to return. I tried usign a Choose expression but Access rejected it saying it was too complex (maybe because too many choices?).
So I'm stuck. And working towards a deadline... :-)
Can anyone help please?
Many thanks,
Martin.
View 1 Replies
View Related
Apr 6, 2005
Can't seem to figure this out.
I built a db for tracking and entering sales info but I'm having a problem with one of my combo boxes. To make entering data easier, I created a combo box that you can select a sales persons name from, then based on who is selected, their Title and Office location also populated.
The problem I have is when I want to manually type in the Name and other info for a temporary sales person. How can I allow users to choose from the drop down or just type it in if that person is not in the list?
Thanks in advance for your assistance.
View 1 Replies
View Related
Sep 1, 2006
Hi
Can anyone create a form with a combobox where you can select a form and this form will display in an static area.
Then you can choose another form in the combobox and it will display in the same spot.
the forms that will be displayed are exactly the same size.
This would help me very much
Thanks
Mikael
View 1 Replies
View Related
Dec 27, 2013
UMMonth1: Choose([Enter Qtr],[OperationsAuditData]![1],[OperationsAuditData]![4],[OperationsAuditData]![7],[OperationsAuditData]![10]).But I keep getting an error message "You tried to execute a query that does not include
"UMMonth1: Choose([Enter Qtr],[OperationsAuditData]![1],
[OperationsAuditData]![4],[OperationsAuditData]![7],[OperationsAuditData]![10])' as part of an aggregate function."
View 2 Replies
View Related
Aug 11, 2013
I have Access 2013 but am new to Access and am learning as I go along!I am making a database of song lyrics so have made a table of the title of the songs with the lyrics for each verse as different fields. I want to be able to choose multiple songs by their title to then show the full lyrics on a report.
View 5 Replies
View Related
Feb 5, 2012
I am new to access. What I want to do is to set up a button in where the value that I typed in a text box besides it, be transferred to the corresponding cell type.
Let's say I typed 100, and then I click Income or Expense, If I press Income it will be sent over to the cell containing the incomes and etc. A check box works too.
Next thing that I want is to create a sub category.
If I have a large categories list like in the personal account ledger template, I want to be able to select a main category and if it has a sub category, give me a drop down box to select the corresponding one.
I enter my value, choose whether its income or expense, date and etc, then if I choose the "Home" category, I want it to allow me to also select whether its "Phone", "Water" and so on.
View 3 Replies
View Related