Enter Parameters Through A Form
Feb 16, 2005
I've searched the forums for quite a while now and haven't exactly found the answer I'm looking for, so I appologize if it's already been covered elsewhere.
I have a tough situation to explain, but I'll do my best:
I have a query that has several fields that are calculated by adding or multiplying other fields in the same query - a few of which are parameters. I have made the parameters the "right way" by going to the query menu and selecting Parameters... and filling in the neccessary Parameters and Data Types instead of creating a new field in the query and putting my parameter info in that way.
So, long story short. I want to have a form where the user can enter in the parameters, select a value for a field from a drop down box, hit a "go" button and a report will be generated listing info from that query.
How do I go about entering parameters through a form and how do I put in a drop down box that will list all of the values available for a field in the query?
Thanks in advance,
Eric
View Replies
ADVERTISEMENT
May 3, 2006
Hi,
I have a Data Access Page which is generated on behalf of a query.
Query uses one parameter field ,so when is started it promts with the form named Enter Parameters in which I have to input parameter value.
So before the DAP is opened, first is displayed parameter form.
I would like to change dimensions of that form(height, width) but I dont know how.
I already tryied by opening DAP in design view & then in microsoft script editor but i couldn't find anything about this pop-up parameter form.
Any suggestions are wellcome:rolleyes:
View 1 Replies
View Related
Sep 11, 2006
I have created a form with multi-select list boxes, behind which is the following code to transform the users' selections into query parameters.
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim varItem As Variant
Dim strCriteria As String
Dim strSQL As String
Set db = CurrentDb()
Set qdf = db.QueryDefs("Test")
If Me!lstAB.ItemsSelected.Count > 0 Then
For Each varItem In Me!lstAB.ItemsSelected
strCriteria = strCriteria & "Centres.[Area Board] = " & Chr(34) _
& Me!lstAB.ItemData(varItem) & Chr(34) & "OR "
Next varItem
strCriteria = Left(strCriteria, Len(strCriteria) - 3)
Else
strCriteria = "Centres.[Area Board] Like '*'"
End If
strSQL = "SELECT * FROM Centres " & _
"Where " & strCriteria & ";"
qdf.SQL = strSQL
DoCmd.OpenQuery "Test"
Set db = Nothing
Set qdf = Nothing
End Sub
I would like to allow the user to set, on the same form, which field they want the resultant data to be sorted by, preferably by having a tick box alongside each list box, which sets that field as the sort field. The form will obviously need to allow only one of these tick boxes to be selected.
Can anyone advise me on how to modify the above code to make this possible?
Thanks,
Gary
View 1 Replies
View Related
Dec 22, 2006
Hi all,
I have a continuous form that is bound to a SQL Server view.
For each record in my form I have a button, which when pressed opens up a second form. The second form is bound to a stored procedure that takes a parameter. The parameter value that I want to pass to this second form is the value of one of the fields in the first form.
I did the following in the click event of the button on my first form:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "SecondForm"
stLinkCriteria = "[Field1]=" & "'" & Me![Field1] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
However, when I run this it keeps prompting me to specify the value of Field1 so this value is obviously not getting through. Do you have any idea why this might be happening?
Thanks in advance
Kabir
View 4 Replies
View Related
Jul 15, 2013
i have a form with a sub form and combobox, when i select item i want that the sub form will be update with new values according to parameters from the combox.
the data of the sub form is from query with criteria
Code:
[Forms]![Examination]![Client_ID]
and the combobox (Client_ID) "After Update" event set to macro- requery (the sub form)
so every time that item selected in the parent form combobox the sub form items /data will change.
*i attached a screenshot
View 3 Replies
View Related
Mar 23, 2006
Good Afternoon,
I am trying to create a form where a user will enter in a value into a text field. Afterwards, when the user clicks "Enter", a query will run and will LOOK FOR THE VALUE THAT WAS ENTERED INTO THE TEXT FIELD. i.e.
User enters their address into the field and clicks the enter button.
Afterwards, a query will run like
select * from customers where address = @address <== the value the user entered into the text field. This is where the mystery lies. How do you pass values?????
Thanks,
Nervous Jervous
View 6 Replies
View Related
Aug 19, 2007
Hi There,
I am trying to get a query to pull dates from a form to use as limiting parameters for a report. One of my forms has the user enter a range of dates into two text boxes (a from-date in one box and a to-date in another) as the range of dates they want to pull information from a table via the query. These dates are also used in the Title header of the report that is generated from the query information.
How can I get the query to use these dates in the text boxes, rather than having to use the "between / and" command on the criteria line of the query design?
If I just have parameter windows pop up and have the user enter the dates there, I can't use those dates for the report, or can I? Any help would be appreciated. Maybe I haven't explained this properly, if so, I'll try again if I've just confused you.
View 3 Replies
View Related
Aug 18, 2015
I have a sample database (attached) where I have a form called frmVoteHeadsOne. The voteheads that I have are swimming (Swim) and transport (Trans), which both appear for data in a table. On the form, from the combo list, I would wish that if I select swimming, for example, only Mark Tyler's name is returned since he has paid 2000; if I select Transport from the same list, only John clement's name is returned.
My purpose for doing this is because in the actual database, I have 21 different voteheads which I would like to get different results from based on what the user selects from the combo list.
View 8 Replies
View Related
Feb 28, 2012
I am creating a booking database for a Bus Hire company. There is also an Invoice element to it, which will Invoice customers for a range of bookings that they've made.You will see in the screen image, the relationships between the four tables:
-tblInvoice
-tblInvoiceDetails
-tblCustomer
-tblBooking
IN tblBooking (see screen dump) the customer is allocated a booking number and so on. However, at the end of the month, the Customer will be invoiced for specific bookings. I would like to, firstly, select the customer in the Invoice form, then in the InvoiceDetails subform, select THE BOOKINGS THEY HAVE PREIVOUSLY Made using a look up. (see screen dump called frmInvoice.Gif)
I have applied a criteria to the data source for the look up. (see image datasource...GIF) with forms![frmInvoice]![CustomerID] in the hope that the query will search for BookingIDs where the currently selected CustomerID (in Form Invoice) finds a corresponding match in tblBooking.
View 14 Replies
View Related
Jun 15, 2013
Is there an easy way of entering a value in a text box, passing to a query to do a count function and then return the value of count function in to anther text box?
View 5 Replies
View Related
Mar 15, 2007
I have created a query that will pull the price of a property into the cost field combo box on a booking order subform depending on the values of the start date and property number enter onto the same form.
The query gets the price from the property price table matching on the property no i've selected on the booking order subform and also the start date i've entered on the booking order subform which needs to be between the start and end date fields in the property price table.
Fields in the property price are property price no, property no, start date, end date and price.
Also the booking order subform is a subform on a booking form
This is the query i have created:
SELECT [Property Price].Price
FROM [Property Price]
WHERE (((forms![booking order subform]![start date]) Between [property price].[start date] And [property price].[end date]) And (([Property Price].[Property No])=forms![booking order subform]![property no]));
The problem is when i run the query from the cost combo box the query isn't picking up the fields on the booking order subform instead its bring up a seperate meesage box from parameters start date and property number to be enter.
Can someone give me advise how to make the query use the values in the fields on the booking order subform i enter before running the query. cheers
View 2 Replies
View Related
Mar 31, 2006
Here's an awkward problem that i'm experiencing...I've created a form and everytime i hit the Enter key, any data that i've inputted disappears . I've noticed on the bottom right corner where it displays form view when i hit enter it say's calculating...and then poof , data gone...i've created a test record, #3738...Any help will be greatly apprecitated...i've attached form for a better understanding...
View 3 Replies
View Related
Aug 15, 2006
I would like to have a user enter a start date and an end date into two
textboxes on a form. The two dates will be used to query a table. I
would then like to print a report that was created from that query.
Here is the query created as a stored procedure:
SELECT Transactions.*, Hoods.*
FROM Hoods INNER JOIN Transactions ON
[Hoods].[ID]=[Transactions].[BoxID]
WHERE ([Transactions].[Date] Between [@StartDate] And [@EndDate])
ORDER BY [Transactions].[Date];
What would be the best way to pass txtStartDate to @StartDate and
txtEndDate to @EndDate in the VBA code of the form? How would I open or
print the report created from that query filtered on that date range?
Any suggestions? Am I going about it wrong? Should I have created the
report from the above query, or should I do it another way? Can anyone
direct me to some code that does all of the above or something
similiar?
Thanks.
View 14 Replies
View Related
Oct 18, 2013
I have a query and a form, and what I want to be able to do is have the user type in within the form the parameters for the query.
The part of the query that will hold the parameters is based on an amount (formatted as Currency), but I want the user to be able to enter >10 , =<100 or >100000 and get the correct results.
I have already set up the query and the form with unbound cells which are then referenced in the query I've tried just one cell where the user would enter >100000 or tried two cells where one cell would be for >,< etc and one cell for the value (which is formatted as currency), but that didn't work either.
The idea is that you enter the parameter and value then click on a button that runs a macro to export the query based or the user parameters, but everytime I try it I get a box appearing saying Property not Found.
View 1 Replies
View Related
Dec 4, 2012
I'm trying to create an archiving system, where i use a simple Append Query followed by a Delete Query.
A typical criteria for the Append Query is less than Date()-30...so any records older than 30 days can be appended to an archive table. This works fine when i enter it in the Query Design criteria row.
But, I would like to make this user-defined. I have set up an unbound form as shown in the first attachment...and made a global variable entitled 'ArchiveDays'. I am hoping to use the variable to act as the criteria for the append criteria. (Please note that in the screendump...they can select an option button if they just want to stick to 1 month old. I also show you my assignment operations there).
My question is... how do i get the variable 'ArchiveDays' value to be the criteria for my append query....
View 14 Replies
View Related
Sep 11, 2014
The input form of the database have one common table containing data for all parameters for row source. As all data was in one table had one ID. My problem is I am trying to run reports from a form after selecting dates and parameters.
For selecting parameters I created dynamic combo box. For dynamic combo box I needed ID and description of the parameters. So I created separate tables for each parameter with ID and Description column. Which ran me into the problem that when I run report based on main input form which has different row source table and my report form has different row source tables and reports doesn't run when I base my queries on the report form.
View 2 Replies
View Related
Nov 10, 2006
Hope someone can help with this one - I have searched the Forum and cannot find any reference to this problem. I have a form which was originally based on a query linking 2 tables - data entry into the form worked fine. I then needed to add another field to the form from another table so I added the 3 table to my query, linked the table and then added the required field to my form and now the form will not allow me to enter or change data in any of the fields. I have checked relationships and they all seem to be OK. I have also tried creating a new query based on the original query and added the new table to that in case there was an issue with the first join, added my new table to this query and then based the form on this new query but the problem stills persists. Is there a limit to how many tables/queries a form can be linked to? Any help would be appresicated.
Cheers,
Bill
View 6 Replies
View Related
Apr 20, 2014
I have Created This Macro (Photo1) to Display Clients Home Address on A Bing Map, however, When I run Code I get A "Enter Parameter Value" Pop-Up. (Photo2) When I actually enter ClientID number in this case 5 it Does what I want See (Photo3). How do I get it to open directly to form with out Enter Parameter Value popup?
View 2 Replies
View Related
Aug 4, 2014
I have a navigation form that will have 6-8 tabs. We were using about that many databases, but we are finally consolidating them into one. The result of us using so many databases has been the multitude of forms and reports that were necessary for each database prior to merging them together.
The problem: There will be anywhere from 12-20 (text boxes) that the user can use to search anything in our database. What we need to have happen, if possible, is for those search parameters to show up in the header of our report if they have text in them. If the text box is blank, it should not show up in the header of the report.
I have read how to to do the start/end date technique, but I do not know if that would work for what we are doing since the boxes would only show up if they are populated by the user.
View 4 Replies
View Related
Oct 29, 2006
Hi,
I want the user to be able to pick from a list the criteria that they can put in when prompted by a query.
At the moment, when you run the query, I have it set up so it prompts for the criteria: [Enter Section:] - so the user has to type in the section.
I want them to be able to pick the section from a drop down list.
I remember vaguely having to set up a form to do this....???
Thanks!
Maria:o
View 14 Replies
View Related
Jan 25, 2005
Hi
I want a filtered pop up form to accept new records.
The archive posting that I found suggested that I insert
[MyForm]![LinkedField] as the default value of the linked field.
Any suggestions gratefully accepted.
Steven811
View 5 Replies
View Related
Dec 11, 2005
Hi all
I am doing my internship now and am new to vba and excel. I need help with the following.
I need to create a form which allows the user to enter records into a table.
The fields for this table is [product type], [Reasons] and [Breaks]. However for each [product type] there is a specific list of [reasons] and [breaks]. I need to reflect this onto the form using drop down lists or list box. That is if the user selects [product 1], the associated [reasons] and [breaks] will populate the other 2 list box. And then the user will click the update button to insert a new record into the table.
Can somebody help me out here? Thanks so much in advance.
Regards
Dominic
View 1 Replies
View Related
Dec 15, 2005
Is there anyway to have a subroutine be called when a form is brought up? meaning, as soon as the user opens the form, stuff happens without them doing anything besides opening the form.
View 1 Replies
View Related
Feb 17, 2006
Hello,
I am making a database and I am currently doing my forms. I have been using wizards and so far everything I have wanted to be able to do has been achievable, except for where I am now! I am making a 'purchases' form. What I want to be able to do is make multiple purchases in the one form. Let me try and give you an example to further explain myself.
Lets say Mr John Smith wants to purchase 1 black pen, 1 30cm ruler, 2 rubbers and a compass.
I want it so that rather than have to add each one of the purchases one by one, I want to be able to add them all in the same time and be able to go back to my purchases table and see:
Mr John Smith - 1 black pen
Mr John Smith - 1 30cm Ruler
Mr John Smith - 3 rubbers
etc
Hopefully you understand what I mean?
Can anyone assist me?
Most appreciated!
Adam
View 8 Replies
View Related
Jul 1, 2014
I was able to enter data into my form but I made a few design tweaks and added another table into the form and now, in form view, I''m unable to enter data into any field.
View 11 Replies
View Related
Mar 28, 2013
I have a main form with a sub form.
I cannot enter new records into the sub form! Only existing records are displayed.
If I open the record source of the sub form, I can enter new records
The subform's Allow additions, deletions & Edits are all "Yes"
View 4 Replies
View Related