Microsoft Access Queries

  • Thread starter Thread starter Guest
  • Start date Start date
Say the drop-down list named MyCombobox is on a form named MyForm. Put this
expression in the criteria of the appropriate field in your query:
Forms!MyForm!MyCombobox
You need to make a selection in the combobox before the form opens or if the
combobox is on MyForm, you need to enter this expression in the AfterUpdate
event of the combobox:
Me.Requery
 
When I do this the query still starts with a dialog box that asks for
[Forms]![MyForms]!MyCombobox. Suggestions?

thanks
aj
 
[Forms]![MyForms]!MyCombobox.

This was purely a suggestion. You need to use the actual names of the
objects. For instance, on a form named frmOrders with a combobox names
cboCompanyName you would have this syntax:

Forms!frmOrders!cboCompanyName

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


AJ said:
When I do this the query still starts with a dialog box that asks for
[Forms]![MyForms]!MyCombobox. Suggestions?

thanks
aj

PC Datasheet said:
Say the drop-down list named MyCombobox is on a form named MyForm. Put this
expression in the criteria of the appropriate field in your query:
Forms!MyForm!MyCombobox
You need to make a selection in the combobox before the form opens or if the
combobox is on MyForm, you need to enter this expression in the AfterUpdate
event of the combobox:
Me.Requery

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com
 
Yes, I did that... just didn't put the exact names in this message. It still
isn't working.

Lynn Trapp said:
[Forms]![MyForms]!MyCombobox.

This was purely a suggestion. You need to use the actual names of the
objects. For instance, on a form named frmOrders with a combobox names
cboCompanyName you would have this syntax:

Forms!frmOrders!cboCompanyName

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


AJ said:
When I do this the query still starts with a dialog box that asks for
[Forms]![MyForms]!MyCombobox. Suggestions?

thanks
aj

PC Datasheet said:
Say the drop-down list named MyCombobox is on a form named MyForm. Put this
expression in the criteria of the appropriate field in your query:
Forms!MyForm!MyCombobox
You need to make a selection in the combobox before the form opens or if the
combobox is on MyForm, you need to enter this expression in the AfterUpdate
event of the combobox:
Me.Requery

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com


How do I create a drop down list from which to select a criteria for a
query?
 
Back
Top