Queries :: User Selected Fields Added To Query Through Parameter

Oct 8, 2014

Is it possible to have the user select which field is added to the query through a parameter? In my query I have a table where each record has a part number and has sales number for each month. When the user runs the query I want them to be able to select which month is returned.

My table basically looks like this:

PartNumber,Jan,Feb,Mar,Apr,May etc.
01PartNumber,15,20,30,25,28 etc.
02PartNumber,12,14,12,16,20 etc

I want the user to enter "Mar" when prompted and return the parts numbers with values from "Mar".

Access 2007

View Replies


ADVERTISEMENT

Modules & VBA :: Writing Code To Open Query After User Selected Fields To Include From ListBox

Jan 14, 2014

Access 2007-10
Listbox created: List62 (I know I need to rename it, but for now)
Multi-select: Extended
Row Source Type: Field List
Row Source: qryFieldList
Open Query: qrySelectedFields (I added primary key to first column, just to have at least one destination field).

Goal: to select multiple fields within listbox, click on command button to open query "qrySelectedFields" with selected fields from list box.This is the code I have on the command_click:

Dim varItem As Variant
Dim strSQL As String
If Me.List62.ItemsSelected.Count = 0 Then
MsgBox "Please select one or more fields.", vbExclamation, "Healthcare REIT"
Me.List62.SetFocus
End If

[code]....

It does absolutely nothing - doesn't add the fields to "qrySelectedFields", doesn't open the query, notta.

View 8 Replies View Related

Queries :: Show Data - Query Based On User Selected Time And Date Range

May 17, 2013

I have a form that request information from the user (StartDate, StartTime, EndDate and EndTime) the problem is that it's not working. The only way I can get any data to show is when I remove the StartTime and EndTime. Only then will it pull the items from the StartDate and EndDate.

Here is what I have as my criteria: Between [Forms]![OpPROD_ALL]![StartTime] And [Forms]![ OpPROD_ALL]![EndTime] And Between [Forms]![ OpPROD_ALL]![StartDate] And [Forms]![ OpPROD_ALL]![EndDate]

The users will be able to request a report based on a start and end date along with a start time and end time.

Side note: this is to pull date for 3rd shift (Example) 4/14/2013 10:00PM - 4/15/2013 10PM

View 1 Replies View Related

Queries :: Append Query With User Entered Parameter Values

Sep 17, 2013

I have an append query that currently looks like this URL...This query automatically adds the machine parameters for a product code and lot number into the running condition log. This is so the user does not have to manually go in and tediously select each machine parameter.

The running condition log also has a date field to specify what day and record number the machine parameter's value was recorded on. When I run the query the appended rows look like this. The product and lot are defined by user parameter and there are actually about 36 machine parameters

Code:
Productstockcode LotNo Day Record Parameter ActualCond
PE-500 130816m71 StockTemp
PE-500 130816m71 Zone 1
PE-500 130816m71 Zone 2

My question is: how do I modify the query to automatically add the date and record number in one shot? It needs to be user defined at the time of the query because this data is not stored anywhere else in the database. For each 36 machine parameters the day and record would be the same.

View 3 Replies View Related

General :: Making A Report With User Selected Fields

Aug 23, 2013

To start, I am going to generalize to a database of Cows. the fields are:

Name (enforced unique/"Primary Key" in access language?),

size,
color,
age.

The goal is to have a form with check boxes for the fields that the user selects. Scenario is one cow buyer cares about size, while another may care about color and be curious on age. So rather than guessing at what reports the users will want, have a form that allows them to select the fields they want then print a report. An intermediate step would be a query to filter the data.

See the picture below ....

Also, from my perspective, this is the basis of the best code i would write; if someone wanted to add a column for cow gender you wouldnt have to change all your forms/queries/reports:

Global import table.Cows

Form 2 in picture (form with check boxes):
for ( i=0, i<width(Cows), i++)
form.create.checkbox cb.append(i)
cb.append(i).label(Cows[i])

Then create the report based on cb0, cb1, cb2, etc. queries

View 3 Replies View Related

Forms :: Totals Query That Shows Results In A Chart - No Parameter Selected

Dec 12, 2014

I have a totals query that shows results in a chart. It takes a parameter to limit results, by a combobox in a form.

Parameter in the query includes the OR "*" expression, in case someone wants to get the results unfiltered.

The Combobox in the form, has an AfteUpdate event that opens the chart (form) every time its value changes, by the [DoCmd.OpenForm "ChartForm" , acNormal] expression.

I don't know how to make it open the ChartForm when no parameter is selected in the combobox.

View 13 Replies View Related

User Defined Parameter Queries / Forms Major Problems !!

Oct 25, 2006

Good Morning

Looking for the user to select a product name from a drop down box (not type in) when running query / report which will return details on only that product rather than all others in the query.

I have got major problems with the custom dialog boxes -- have got a table of product names, a query called current stock ( active products) . I can easily get a standard dialog box by putting [product code] in brackets in the query and this is not a problem. However in getting a custom dialog box I have had lots of problems.

Created a form called form999 which has product name field as a combo box and this has been named master1 . Clicking the form on it's own brings up the dialog box correctly and the drop down box selects the current products which is should do.
However linking it to the query I have put [Forms]![form999]![master1] in the query and it will not link unfortunately and is driving me mad.
Upon running the query it simply brings up the standard dialog box with [Forms]![form999]![master1] as the "enter parameter value. Understand code is required to get the OK and cancel macros working etc but when I click the query it should bring up the custom box which is the first stage and it is not ?? Any assistance would be greatly received.

Are there any sample DBs which have a field or related parameter as a customer dialog box -- have looked for examples without success.

many thanks and regards
Ian Watson Yarm UK

View 2 Replies View Related

Queries :: Parameter Drop Down To Save User Input In Full Domain Field Name?

Oct 14, 2013

I have created a query with the parameter for the Domain field. however on the form the user enters this information via a drop down menu. i was just wondering could the parameter box be set to a drop down box as well to save the user entering in the full Domain field name?

View 6 Replies View Related

Forms :: Restrict User Input In Textbox Depending On What Option User Has Selected

May 22, 2013

I am building a form in access and I am trying to find a way where user input isn't possible in the associated textbox when "No" from on option box is selected.

View 3 Replies View Related

Parameter Query - Allow User To Select All

Oct 10, 2006

I want to be able to have multiple parameter queries, but the user needs to have the option of entering a parameter or not limiting the output at all. How do I let the user choose "all", or what do they type in so that nothing is excluded?

View 14 Replies View Related

Queries :: New Record Added To Table But Doesn't Show Up In Query

Aug 4, 2014

I have a database used to track my personal assignments, created about six years ago using Access 2003 on Windows XP. Recently upgraded to Access 2010 on Windows 7. At some point thereafter, I started having the following issue:

When a new record is created, that record gets added to the table, but doesn't show-up in any query, form, or report until after another new record has been added. The most recently added record cannot be located to view or update, except in the table, until after another new record has been added to the table. Queries, forms, & reports now always lag behind by one record.

None of the queries, forms, or reports tested contain filters. I have several multi-user databases that I also support and none of those users have reported having this problem. This is only happening on my personal database.

I've re-created this database once or twice in the past to resolve other issues, but would like to avoid that route this time around, if possible.

View 7 Replies View Related

Queries :: Cannot Assign Any Data Values To New Field Added To Query

Aug 12, 2015

Created a new Query (called qry_Temp) from and existing Query (qry_Test that has fields Field1 - Field5) using QueryDef , and inserted a new Field (FieldX) into it (see example below) using the .Parameters property, then opened a Recordset based on the new Query in order to attempt to enter data values into the new Field (FieldX) for each record in the query - but cannot assign any data values to this new Field (but can to the existing fields) in the new Query?

Dim DB As Database
Dim rs As DAO.Recordset
Dim qdfNew As QueryDef
Dim strSQL1 As String
Dim strSQL2 As String
Dim Value1 As Integer

[Code] ....

View 6 Replies View Related

Wildcard Query With User Input Parameter Not Working

Jul 12, 2007

I'm using an Excel spreadsheet that is importing external data from an access database in which I've got a field where the name of a person checking materials out is entered. it is currently set up, and I cannot change it, as a free form field. So folks enter information in a variety of ways.

For example, Larry Martin might be entered as "Larry Martin" or "Martin, Larry" or "larry.martin@somewhere.com". I'm trying to run a query that would look in that field for any entry with the string I enter, such as "Martin."

I've tried setting the criteria like this:

Like "*" & [Which Last Name] & "*"

However, when I try and run the query I get a message telling me the system is expecting two parameters.

Does anyone have any idea what I'm doing wrong? I've been banging my head against this for awhile now and am thoroughly stumped! All assistance, as usual, is greatly appreciated!

View 1 Replies View Related

Queries :: After Importing Data Query Not Picking Up Newly Added Records

Apr 21, 2013

I created a database. exported some Excel data into Access tables, created a number of lookups, default values etc. and created a pretty simple query.

My problem is that after importing and tweaking the data, when I add new records, my queries do not pick them up!
I have tried:

1. saving, closing, opening and re-running the queries.
2. putting an Nz expression for each field in the query as I read that null values may cause a problem.
3. wrote the query again, field by field to see if all records were received.
4. Exported the table back to Excel and imported to a new Access table in my database

None of this works.

View 7 Replies View Related

Queries :: One Parameter For Multiple Fields

May 20, 2013

Is there a way to have one parameter in a query effect multiple fields?I have a table that details service calls on our equipment. There are columns in that table for each part of the equipment that get marked, depending on what needed serviced (i.e. software, printer, keypad, monitor, etc). I would like to be able to run a query that will show all the service calls where one part of the equipment was serviced multiple times without have to enter multiple parameters or write a union query (there would need to be 11 unions or 11 parameters for each part to be captured). For example, I would want to know how many pieces of equipment had 3 or more service calls on their software. I want to run the query without having to say that I don't care how many service calls were performed on the printer, monitor, or keypad. I would like to be able to say "Software >3" and have the query run on that information.

View 1 Replies View Related

Modules & VBA :: Parameter Query - Detect If User Has Not Entered A Criteria

Dec 12, 2014

I have a report that is fed by a parameter query. When a command button (Command23) is clicked a parameter box opens and the user enters a subsystem number. A report for that subsystem then opens.

I want to open the report with VBA and show a message if the user has failed to enter a subsystem number in the parameter box and just clicked OK.

The problem is I don't know how to refer to the parameter box and detect if it has been left empty before clicking OK. I first tried to use IsNull in an If statement with Command23.Value, but now realize it is the value in the parameter box I am after, not the "value" of Command23.

How can I change my code to detect if the parameter box has not been filled out?

Private Sub Command23_Click()
If IsNull(Command23.Value) Then
MsgBox "You did not enter a Subsystem", vbOKOnly, "No Criteria Entered"
Else
DoCmd.OpenReport "rptTESTInfoBySubsystem", acViewReport
End If
End Sub

View 1 Replies View Related

Can I Dynamically Choose Which Fields Are Being Selected In A Query?

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

Query With Parameter To Select Certain Fields

Jan 12, 2008

Hi, I need help in creating a parameterized query.

I need to show only certain fields depending on the value of the parameters.
For example, I have a table with fields: ID, Name, Phone Number, Address, DOB.
The parameter can only be value of A, B or C.
If the user input A as the parameter in the query, only field ID, and Name will be shown
If the user input B as the parameter in the query, field ID, Name and Phone Number will be shown.
etc.

Is there any way to do this, rather than to separate the query into 3 queries for each of the parameters? Thank you.

View 1 Replies View Related

Forms :: New Fields Added To Table / Won't Look Up On Form

Sep 8, 2014

I have this table that I built a form from . I added some fields to the table, most of which are look up. I added those fields to the form.When I try to test the form those lookups show nothing.I used the lookup wizzard.I removed those fields and added new ones (same problem).I compared them to the ones that are working - they are identical.I changed the control source to one that is working - didn't work.

View 1 Replies View Related

Queries :: Edit Records Selected By Query

Dec 31, 2013

I have a query that selects records based on certain flags in each record. I can view the record in datasheet view, but I need to be able to edit the records selected by the query using another form. Is there any way to automate this process?

View 14 Replies View Related

Queries :: Command To Print Selected Query

Jul 11, 2014

I am trying to print selected query how can I do that what is the command for that ...

View 1 Replies View Related

Queries :: Group Query By Day Of Selected Month

Jul 21, 2015

I am trying to make a query that counts the orders on a day of an specific month selected from a form.

The problem is that i want to show a chart with de 31 days of the month, even if in those days there are no orders.

Any way of making a query that adds the days with no records with a count value of 0?

View 3 Replies View Related

Queries :: Way To Construct A Query From Selected Inputs

Nov 27, 2014

I have a form with several fields and combo boxes on which the user will select different criteria to generate a report.The default value for each of these fields/cbo's is "*", so if the user changes nothing from the default, I execute a basic "SELECT *" query.

If however the user enters some value (selects a specific date range, customer number, salesman,etc), I would like to 'easily' modify my query to accommodate the entered search criteria.Trying to construct SQL when there are many search options like this is difficult. I took a stab at using QueryDefs but I'm struggling to find example VBA code as an example.

View 1 Replies View Related

Queries :: MS Access - Selected Query To Appear In Color And Bold

Mar 24, 2013

I have this Access file with Tables & Queries.

I want selected queries to appear in RED colour and if possible BOLD too.

Possible ?

View 2 Replies View Related

Queries :: Limit Query To Selected Items In A List Box

Nov 27, 2013

I want to limit the results in a query to the selected items on a list box - how do I do this?

View 4 Replies View Related

Added Fields To Table But Not Showing Up In Form Field List

Aug 3, 2005

I have a form based on a table and I just added 3 fields to the table. When I go to the form to add these fields, they do not show up in the field list. I've also tried creating a textbox and going to the Data Tab and choosing the data source but those 3 new fields are still not showing up.
How can I go about adding these 3 fields?

Thanks in advance

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved