Forms :: Running A Query Based On User Selection Criteria On Form
Jan 9, 2014
I have a form which lets the user enter a contract ID and then a combo box that has a list of reports which run against whichever ID is entered.
What I want to know if I put the ID's in a table if theres a way to allow the user to select multiple ID's in one go and run the report against them the range rather than 1 at time?
I'm thinking about utilising the check/tick boxes would this be possible? or another way?
I'm using 2003 and have some VBA ability.
View Replies
ADVERTISEMENT
May 1, 2015
I have a list box that is correctly listing resources from a table (tblResource). I would like to select one of the list box entry and run a query against the tblResource to show the information for that resource in a form. I have tried to use the lstindex with the control (lstResource) in the where clause of a query to accomplish this with no success.
View 5 Replies
View Related
Feb 3, 2014
The user will be creating a new project that contains a bunch of releases. The releases have standard names which are stored in a table tbl_ReleaseNames It should be noted that the list of names is not static.
The user selects which of the releases pertains to their project and then based on their selections, new records would be created in tbl_RFP_Release and then a subsequent form would open where it would display each of these newly created releases where they could enter additional information. I thought of creating an unbound checkbox associated with each of the standard names, and then checking to see if the checkbox was checked and then creating the new records followed by opening up the new form.
View 6 Replies
View Related
Dec 18, 2013
I am trying to run a query and display the results in a report (the report side of it is childs play and not a problem). The problem I am having is that I have a search form which should allow the user to search any one of 6 fields (text boxes) or a combination of each.
If the user enters something into a field then that search criteria must match. I wanted to have it so if all fields are left blank then it will show all entries in the database (but it isn't, it shows a blank report). I also wanted it to allow partial completion of boxes.
So for instance if I have 5 customers (Jones, Jonson, Jonus, jimjonkins, Janis) and I type "Jon" into the name field then I would like it to show the first 4 records as they all contain "jon" somewhere in their name but its not, its only allowing exact matches.
I currently have '[forms]![Search_Customer]![Search_Name]'.
View 2 Replies
View Related
Mar 19, 2008
Hello All,
I do hope somebody can help this newbie :)
Please except apologies if I sound a bit ignorant with this but I'm complete novice with Access...
Basically I have a table with the fields Name - Date - Location I need to extract info from the table based on the location field.
i.e. return Name if a specified location exists and another specified location does not. This was real pain in itself and in the end I had to run two seperate queries which returned NAmes where each of the chosen locations exist. I've then created an additional query which compares the two sub-queries and iliminates Names that appear in sub query 2.
I do hope this make's sense I'm starting to confuse myself.....
Anyway, my problem is with the date field... I have to specify a date in order to get the correct info as the results may change on a daily basis... i.e. somebody may use both locations one day, but just the one location the next. However the eventual report which I need to generate is based on criteria over the previous 7 days, although if I use this criteria in my query in completely messes up the results.
So, what I was hoping that I could do is somehow automate my query to run 7 times (once for each of the previous 7 days) and then to combine the results of the 7 queries into a single query or report...
Failing that, could anybody think of any simple way of achieving this... or will be a case of having settle for a seperate report for each day?
Any help would be hugely appreciated... once again apologies for the explaination... It porobably makes no sense at all.
Regards,
Andrew
View 2 Replies
View Related
Oct 30, 2013
I have a query I am trying to build currently which creates a running total based on set criteria. I essentially have three columns (All times are in minutes). The visit ID, the duration of a visit and the time difference between the current and previous visit. e.g.
ID Duration Difference
1 30 0
2 45 10
3 15 20
4 60 10
5 15 10
What I would like to achieve is the following:
ID Duration Difference running total
1 30 0 30
2 45 10 85
3 15 20 15
4 60 10 85
5 15 10 110
So a line will have the calculation of the current time + the difference between the current and previous visit if the difference is below 20. I have the following:
Code:
Public Function Cont20(MyVal As Long, MyDif As Long) As Long
Static OldValue As Long
Dim NewValue As Long
If MyDif >= 20 Then
NewValue = MyVal
OldValue = 0
[Code]....
Which I put as Cont20([Duration],[Difference])
The problem seems to be on the return aspect, its not calculating correctly. I had the formula in Excel which worked great, but this is proving troublesome. As a note the Excel formula was such that it would add the previous running total and then add the current duration and current diff. e.g. In cell A7 the formula would be A6+B7+C7 and so on.
View 6 Replies
View Related
Apr 6, 2012
how I can have a combo box on a form, and once a value is picked, return a query that displays all the data based on that value. I have tried using sub forms and the after update but I cant seem to figure it out.
View 2 Replies
View Related
Nov 10, 2005
Hello,
I am trying to create a unique reference number that includes the default autonumber and another count based on what the user selects from a dropdown (B).
For example, the reference might look something like these examples:
AutoDropdwnADropdwnBCount
001DrinkMocha1
002DrinkEGrey1
003DrinkEspresso1
004DrinkLatte1
005DrinkEGrey2
006DrinkEGrey3
007DrinkEGrey4
008DrinkEspresso2
009DrinkLatte2
010DrinkEspresso3
I will eventually create a unique reference by combining all the data (ie: 004-Drink-Latte-1, 010-Drink-Espresso-3) but it will allow me to number each type of drink in ascending order irrespective of the autonumber (which is the primary key.)
I would appreciate any advice on how to approach this! I am baffled!
Thanks,
dj_T
:eek:
View 2 Replies
View Related
Aug 18, 2015
I have a query that uses the input from a form as criteria, which is then used in a report. The form input is a drop down based on another table. This is a sales pipeline report, and the list is a list of sales people. The report works perfect for all sales people except one. When I run it for the one, I get the following error:
"This expression is is typed incorrectly, or it is too complex to be evaluated. For example, a numeric expression may contain too many complicated elements. Try simplifying the expression by assigning parts of the expression to variables".
I DO NOT get the same error when running the query by itself - so assuming there is something in the report causing this. I do have some sum formulas in the report.
Again, no other salespersons selected cause this error -- so I am assuming there is something in the dataset for this person that is causing the error.
View 8 Replies
View Related
Jun 13, 2006
Hi,
I have a query that I would like to run from a form. I have created the button and the query, but want to add in a clause that will use the user selected record / field as the criteria for the query when its run.
Got any examples of code I could have a play with
I am struggling here so need any help I can get!!
Cheers
Paul
View 1 Replies
View Related
Nov 25, 2013
I have a form that runs off a query that displays further details of a record in a datasheet when you double click on a row.
The query itself has criteria that looks at the open form and selects the correct record.
My question is can you change the results of the query either using vba or a built in feature of access without having to use a separate query.
The selection criteria in the query is:
Forms]![Main]![Ordering-Supplier]![Ordering-Order List].[Form]![suppOrderID]
Basically I want to override the resulting data with another record when I run an event on the form.
View 3 Replies
View Related
Dec 9, 2005
Hello,
I'm stuck! I want to create a form which has a combo box where you select
someone's name, and their address appears in another text box on the same form. The names and addresses are in a table called "cardholders".
I'm doing separate combos for first name, surname cos I think that's the only
way you can do it.
The fields in the table are credit_add, credit_name & credit_surname. The combos are called "cardholder name" "cardholder surname" etc. This is the code in the text box where I want the address to appear:-
=DLookUp("[credit_add]","cardholders","[credit_name] = '" & [cardholdername] & "' And [credit_surname] = " & [cardholdersurname])
Can anyone help?
Thanks.
View 3 Replies
View Related
Jan 12, 2015
My table has a yes/no field and about 10 records. I have created a form for the user to select which of the records he wishes to use - the records are displayed in a continuous form with a check box for the yes/no field. The user is to select one record by checking the check box in the record.
I know this should be obvious, but I can't see it. How can I make it so the user can only select one of the records (when he clicks on one, that one is yes and the others revert to no?
View 4 Replies
View Related
Sep 17, 2013
I have a tblCommets that has 2 columns in it. The first is an identifier (1,2,3) and the second column is a comment associated with that identifier. Is it possible to use a query to pull that comment based on a user selection? So, if the user selects 1 then the comment associated with 1 is pulled, but if the user selects 2 then that comment results.
Code : =Select[tblComments].Column(2)
View 1 Replies
View Related
Mar 17, 2014
I have two forms linked together.
frmMaterialRequest
MaterialRequest
Status
frmHandledBy
MaterialRequest
HandledBy
What I want is to meet the following:
- Form 2 to be locked but its "MaterialRequest" is enabled.
- HandledBy to be unlocked if the MaterialRequest meets the "Status" of "frmMaterialRequest" which is "Approved".
View 9 Replies
View Related
May 26, 2013
I have "donations" form with a cbo called "DonationType".
(frmDonations.DonationType)
General
Employee Match
Employer Match
Angels*
Friends*
Royal Crown*
The last three options need to redirect the user to a different form used for pledged donations.
View 2 Replies
View Related
Feb 12, 2014
I have three different forms.
1. form is a Login form where i choose between: AA, HH or FA
After choosing on my first form second form opens.
Now my question - how can i do the following:
Based on the combobox in form 1, my button i form 2 will either open form 3, 4 or 5...
View 1 Replies
View Related
Feb 13, 2006
Hi,
I've been working on a database to keep track of employee time off, It consists of the main table, a employee table, and a department table.
I had a form that our admin uses to enter the info for each employee.
They would select the name of the employee from a drop down, and then select the department that employee is in from another drop down. then they would select the days off and reason ect. Then when finished they would hit submit and this would be entered into the main table.
Well they just asked if it would be possible to make it so when they enter the employee's name, that the department would automatically be filled in for the employee.
Is this possible? I'm trying to think of how to do it, but not coming up with anything.
Thanks
Chris.
View 1 Replies
View Related
Sep 25, 2014
I have a combo box which gets its values from sql server using a query which is called "get_query_reason", which works fine. Now I want to update combo box values based on a user selection, st string. Have written the code, but does not work:
Dim qDef As QueryDef
Dim Query As String
Dim st As String
Dim rs As Recordset
st = "SOV"
Set qDef = CurrentDb.QueryDefs("get_query_reason")
[Code]....
View 3 Replies
View Related
Mar 20, 2013
I have a report that gets its data from a query. I need the query to run before the report based on criteria based from two combo boxes on a form.
View 3 Replies
View Related
Jul 30, 2013
I would like to set up a picture in the form that changes based on a combobox selection, for example if you select from combo box list "design1", a picture that have a name : design1 will appear as a background to the form ..
View 8 Replies
View Related
Jun 21, 2015
I have been looking some information on changing image based on form combo box selection on form.
I manage to do case by case but i need it in a simple code because their will be many employees just to avoid adding case by case code for each one.
Private Sub Emp_IDCombo_AfterUpdate()
Select Case Emp_IDCombo.Value
Case "AM-001"
Imageholder.Picture = "C:UsersAMGDesktopam-001.jpg"
Case "AM-002"
Imageholder.Picture = "C:UsersAMGOne DocumentsHR & Admin DatabaseEmployee Picturesam-002.jpg"
End Select
I have employees table where all images location is saved in text field and i have a combo box on form which is employee id.
Tables relationship
Employees_table [PK] to Contracts_table [FK] via field name {emp_ID}
Fields Name
Combo Box name on form Emp_IDCombo and row source is SELECT Employees_table.Emp_ID, Employees_table.EmployeeName, Employees_table.Emp_Pics FROM Employees_table;
Text field is located in employees_table called [Emp_Pic] for images location.
View 10 Replies
View Related
Feb 15, 2015
I have been building a database for use in a charity shop and am struggling with an issue regarding one of the forms.
I currently have a form which displays all expenses from the shop. I have added a combo box to the top of this form which allows users to filter records based on an expense ID Code. It all works fine but I would like to be able to add a start date and end date box to the form also so that records can be shown between two dates.
I have tried adding parameter boxes to the query which runs the form (which works) but the issue I am having is that when a new id is selected from the combo box the parameter boxes pop up again asking me for start date and end date again. This happens every time a new combo box id is selected.
I think the way resolve this issue may be to add a start date and end date box to the form but I don't know how to implement this.
Please see the attached files for images of what I currently have. The forum won't let me post images directly here until I have 10 posts so I have had to attach the files instead.:
Query running the form - Attachment 1
The Form itself - Attachment 2
Combo Box - Attachment 3
Bound Column on combo box - Attachment 4
Code in Combo Boxes after update event - Attachment 5
View 3 Replies
View Related
Jul 18, 2013
I have a Customers table and an Orders table. My Customers table is a bit different than the norm because I couldn't figure out any other way to do this.
My client's customers are either businesses (companies) with a contact person, or individual customers. So, in the Customers table, I have the following fields (there are others but do not apply to my problem):
Customer ID
Company
Contact
Customer
So, if it is a company the data entry person would enter the company name and the full name (EX: Doe, John) in the contact field, but if it is an individual customer, then they would leave Company and Contact blank and enter just the Customer name (Ex: Doe, Jane).
So, in the Orders table, I have combo boxes for look ups for the fields Company and Customer.
That works okay, but I would really like for the Customer ID to post into a text box once the Company or Customer has been selected. In other words, the input person would enter the name, then it would show that Customer's ID #.
View 1 Replies
View Related
Sep 15, 2013
I have tab control form with (5) tabs. For this discussion - Tabs 1 through 5. For a blank (new) form sheet tabs 4 & 5 need to be hidden. Based on what is selected via the drop down box (on tab 1) then tabs 4 & 5 may remain hidden or needed to be un-hidden. Example: [DropDown1]
Selection 1: stay hidden
Selection 2: unhide
Selection 3: unhide
Selection 4: stay hidden
Selection 5: unhide
Selection 6: stay hidden
Selection 7: unhide
Selection 8: stay hidden
Selection 9: stay hidden
I think one I figure this out then I can use the 'OnCurrent' event to check the drop down selection as a user selects the a record or scrolls through records.
View 2 Replies
View Related
Dec 6, 2013
What I have is a form that takes in information regarding test data. Each test run can record data for multiple requirements. I am able to pull all data fine, however in order to make it easier on the user i was hoping to populate the requirements subform based on a selection of "test group" in the main form.
Commonly run together requirements can fall in to groups. I have a selection box for these groups in the main form and a table that stores these group id's and group setup. Is there a way to autofill the tables records that the subform is linked to based on the selected test group?
View 3 Replies
View Related