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!

CBO Problem :Asks for Parameter Value? 1

Status
Not open for further replies.

smille777

Technical User
Jun 27, 2004
43
US
Hi All.....

I have a small problem with a dependednt cbo box [ProductID] asking for parameter value, where the value SHOULD have been set in the [CustomerQuoteID] field.

PROBLEM is that after I enter the value in [CustomerQuoteID] it asks to Enter Parameter Value "Forms.Order_Details_Subform.CustomerQuoteID".

If I enter the Value the dependent Combo works fine. What have I missed, so that I do not need to enter the parameter value?


Here is whwt I have:

Subform's name is "Order_Details_Subform" and has an UNBOUND Field [CustomerQuoteID]

with the following Row Source:

SELECT tblCustomer_Quotes.CustomerQuoteID FROM tblCustomer_Quotes ORDER BY tblCustomer_Quotes.CustomerQuoteID;

After Update =
Private Sub CustomerQuoteID_AfterUpdate()
Me![ProductID].Requery
Me![ProductID].SetFocus
Me![ProductID].Dropdown
End Sub


Combo [ProductID]

Row Source=

SELECT A.ProductID, A.Manufacturer, A.CustomerPartNumber, A.Qty, A.UnitPrice, B.QuoteDate FROM tblCustomer_Quotes AS B INNER JOIN tblCustomer_Quote_Details AS A ON B.CustomerQuoteID = A.CustomerQuoteID WHERE (((B.CustomerQuoteID)=[Forms].[Order_Details_Subform].[CustomerQuoteID])) ORDER BY A.ProductID, A.Manufacturer, A.CustomerPartNumber, A.Qty, A.UnitPrice, B.QuoteDate;

PROBLEM is that after I enter the value in [CustomerQuoteID] it asks to Enter Parameter Value "Forms.Order_Details_Subform.CustomerQuoteID".

If I enter the Value the dependent Combo works fine. What have I missed, so that I do not need to enter the parameter value?


THANKS!!!!!!!
 
How are ya smille777 . . . . . .

SubForm referencing problem in query for Combo RowSource. Try this (you substitute [purple]YourMainFormName[/purple]):

[blue]SELECT A.ProductID, A.Manufacturer, A.CustomerPartNumber, A.Qty, A.UnitPrice, B.QuoteDate FROM tblCustomer_Quotes AS B INNER JOIN tblCustomer_Quote_Details AS A ON B.CustomerQuoteID = A.CustomerQuoteID WHERE (((B.CustomerQuoteID)=[purple][Forms]!YourMainFormName![Order_Details_Subform].Form![CustomerQuoteID][/purple])) ORDER BY A.ProductID, A.Manufacturer, A.CustomerPartNumber, A.Qty, A.UnitPrice, B.QuoteDate;[/blue]

Calvin.gif
See Ya! . . . . . .
 
Hello Again Ace Man!

Well, it eliminated the "Enter Paramater Value" BUT now [ProductID] is not displaying any data, wher before I had to enter the parameter and it yielded the correct data.

Any idea why this would happen??

 
smille777 . . . . .

Are you saying data is in the combo except the ProductID field?

Are you sure the width of the productID field is not set to zero?

Calvin.gif
See Ya! . . . . . .
 
No, there are 6 columns, as set in the above SELECT statement. NONE of them are showing.

Scott

 
Hi,

You said that [PRODUCT ID] is not displaying any data.

Not displaying data where?

Where are you viewing this data? Can you see other data per record?

Regards,

Darrylle

Never argue with an idiot, he'll bring you down to his level - then beat you with experience. darrylles@yahoo.co.uk
 
smille777 . . . . .

Then the query is saying there are no matching records for:
Code:
[blue]B.[purple][b]CustomerQuoteID[/b][/purple])=[Forms]!YourMainFormName![Order_Details_Subform].Form![[purple][b]CustomerQuoteID[/b][/purple]][/blue]
You know for a fact that the above criteria is true?

There is a matching CustomerQuoteID between the subform and B.CustomerQuoteID?

Calvin.gif
See Ya! . . . . . .
 
Hey Darrylle/Aceman!.

ACE MAN: No, there is NOT a matching [CustomerQuoteID] field in the Main Form.

Originally, I had ONLY an unbound field [CustomerQuoteID] in the subform, which [roductID] was dependent on.

The columns in [ProductID] showed, but it asked for "parameter value"

Is there no way to have the [CustomerQuoteID] field only in the subform (and not have to enter parameter value)?


Thanks guys!

 
smille777 . . . . .

A deeper explanation . . . .
Code:
[blue][purple][b]B.CustomerQuoteID[/b][/purple]=[Forms]!YourMainFormName![purple][b][Order_Details_Subform].Form![CustomerQuoteID][/b][/purple][/blue]
This means: CustomerQuoteID of the [purple]subForm[/purple] is to match CustomerQuoteID of Table B.

Since your pinging against CustomerQuoteID, is CustomerQuoteID on the subForm now?

Calvin.gif
See Ya! . . . . . .
 
Ace Man.

I wish there was an easier way to communicate with you and have you walk me through this.

I understand the code you had written. [CustomerQuoteID] ALWAYS existed on the Sub Form, NOT the Main Form.

This is why originally I had written the code to ONLY refer to [CustomerQuoteID] in the Subform:

ie. SELECT A.ProductID, A.Manufacturer, A.CustomerPartNumber, A.Qty, A.UnitPrice, B.QuoteDate FROM tblCustomer_Quotes AS B INNER JOIN tblCustomer_Quote_Details AS A ON B.CustomerQuoteID = A.CustomerQuoteID WHERE (((B.CustomerQuoteID)=[Forms].[Order_Details_Subform].[CustomerQuoteID])) ORDER BY A.ProductID, A.Manufacturer, A.CustomerPartNumber, A.Qty, A.UnitPrice, B.QuoteDate;


What I don't (and need) to understand is whether (and why) I can perform this operation without referring to the MAIN FORM.
 
smille777 . . . . .

Any chance you can send a copy as and an attachment?

See my profile . . . .

Calvin.gif
See Ya! . . . . . .
 
Have you tried something like this ?
Private Sub CustomerQuoteID_AfterUpdate()
Me![ProductID].RowSource = _
"SELECT A.ProductID, A.Manufacturer, A.CustomerPartNumber, A.Qty, A.UnitPrice, B.QuoteDate" _
& " FROM tblCustomer_Quotes AS B INNER JOIN tblCustomer_Quote_Details AS A" _
& " ON B.CustomerQuoteID = A.CustomerQuoteID" _
& " WHERE B.CustomerQuoteID=" & Me![CustomerQuoteID]" _
& " ORDER BY 1, 2, 3, 4, 5, 6;"
Me![ProductID].Requery
Me![ProductID].SetFocus
Me![ProductID].Dropdown
End Sub

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PH, Thanks for the input.

It gave me an Expected end of statement error at the (..." _ )of


& " WHERE B.CustomerQuoteID=" & Me![CustomerQuoteID]" _
 
Sorry for the typo.
Replace this:
& " WHERE B.CustomerQuoteID=" & Me![CustomerQuoteID]" _
By this:
& " WHERE B.CustomerQuoteID=" & Me![CustomerQuoteID] _

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
You are a GENIOUS PH!!!!!!!!!!!!!!!!!!!!!

Everytime you have responded to a thread of mine you are a single and straight shot!!

Excellent!

Thank You, so much!!!!!!

Scott
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top