Multi-form to drive query

  • Thread starter Thread starter Allen
  • Start date Start date
A

Allen

Instead of creating many variations of the same query, I
would like to create a form that has reference fields for
an underlying query. For Example:
Prompt for Report By: Part#, EquipmentId, or PartCategory.
If Part# then provide Textbox for input
If Equipment or Category then dropdown list for selection.
Once this is determined then there would be a selection of
other fields with checkboxes for the user to indicate
whether they wanted the field included in the query or not
and if clicked some would provide a textbox for criteria
to be entered. The output would be PART#,EquipmentId,
PArtCategory and filtered data from checked fields(or all
if no criteria indicated). If do-able can an Access novice
get some pointers from you experts?
thanks
 
You can use values in the controls on forms to provide criteria for a query.
The form must be open (hidden or visible) for this to work. Remember, that
the Bound column of a combobox is the column that gives the Value to the
combobox, so when you refer to the combobox in your query, this is the value
you'll be getting unless you specify otherwise.

To refer to the control on a form you need to give the full path to the
control.

Example:
Forms!frmMyForm!cboMyCombobox

If the form is a subform, you have to go through the main form to get to it:
Forms!frmMyForm!sfmSubformControl.Form!cboMyCombobox

The sfmSubformControl is actually a control on the main form, not the
subform itself. This control is what holds the subform.

Adjust the names of items, such as frmMyForm, to the actually name of your
form or control.
 
Back
Top