Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Window asking for Parameter values

Status
Not open for further replies.

Watermelon

Programmer
Apr 16, 2001
68
US

Hi,

I have a combobox where a user can select a particular page number. On the change event of the combo box this page number goes into the filter so that the subform should only display those records that match the page number selected.
Everytime the change event of the combobox fires, however, a dialogue box comes up asking the using to enter a parameter value. Does anybody know why this would happen?
This is the code I use in my filter. DoCmd.ApplyFilter , "CatalogPage = Forms!AdvancedPartsMaintenance!cboPage"

Thanks for any help,
TM


Thanks
 
This usually happens if you have typo or incorrect name. Check to make sure that is a valid field name... Terry M. Hoey
th3856@txmail.sbc.com
While I don't mind e-mail messages, please post all questions in these forums for the benefit of all members.
 
I think this is the proper syntax:

DoCmd.ApplyFilter , "CatalogPage = ' " & FormsAdvancedPartsMaintenance!cboPage & " ' "

assuming that CatalogPage is a text value.

This way, if the combo box contains the value of 5, then the filter that is passed to the function is:

CatalogPage = '5'
NOT
CatalogPage = FormsAdvancedPartsMaintenance!cboPage

If CatalogPage is a number, then you remove the single quotes:

DoCmd.ApplyFilter , "CatalogPage = " & FormsAdvancedPartsMaintenance!cboPage

Mike Rohde
rohdem@marshallengines.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top