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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Controlling Subform Combo Box from Mainform Field

Status
Not open for further replies.

Sarah28

IS-IT--Management
Aug 6, 2000
16
US
Hi there!
I hope someone can help. I am using Access 2000

I have a main form called "frmPurchaseOrder" the source of this form is "tblMachine" it has a field called "Model" and a subform which has a combobox call "Pricingcategories"

The form is opened from a previous form and the value of "Model" is automatically diplayed based on the previous forms record.

I would like "PricingCategories" to be show only those records for the value of "Model" in the parent form.

I am using the following code but getting a syntax error that says "Syntax Error - at or near ".""

Here is the code I am using

SELECT DISTINCTROW tblPricing.ID,tblPricing.Model, tblPricing.Pricingcategories FROM tblPricing WHERE (((tblPricing.Model)=[Forms]![frmPurchaseOrder].[text10].[Model])) ORDER BY tblPricing.Pricingcategories

Please Help - Thanks

Sarah
[sig][/sig]
 
I am not 100% sure, but try changing from the parenthesis around tblPricing and around Model to square brackets:

Was:
Code:
SELECT DISTINCTROW tblPricing.ID,tblPricing.Model, tblPricing.Pricingcategories FROM tblPricing WHERE (((tblPricing.Model)=[Forms]![frmPurchaseOrder].[text10].[Model])) ORDER BY tblPricing.Pricingcategories
Now:
Code:
SELECT DISTINCTROW tblPricing.ID,tblPricing.Model, tblPricing.Pricingcategories FROM tblPricing WHERE (([tblPricing].[Model]=[Forms]![frmPurchaseOrder].[text10].[Model])) ORDER BY tblPricing.Pricingcategories
Hope this helps...
[sig]<p>Terry M. Hoey<br><a href=mailto:th3856@txmail.sbc.com>th3856@txmail.sbc.com</a><br><a href= > </a><br>Ever notice that by the time that you realize that you ran a truncate script on the wrong instance, it is too late to stop it?[/sig]
 
Nope...That didn't work,

Thanks for trying though.

[sig][/sig]
 
Sarah

I have a small db which I think has what you're looking for.

I can mail it to you if you'ld like.

Umbane

m5gaut@mweb.co.za [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top