Populating row source type of combo box with query dependent upon form field

D

Don

I hope I can explain this thoroughly.

I have a main form that shows sale unit data for a particular
SaleUnitID. Within that form, I have a subform that allows the user to
enter bid data into a bid table linked by SaleUnitID.

I would like a combo box in the main form that, when dropped down,
allows the user to pick the winning bidder from the bidders who have
bid on the current SaleUnitID that is being displayed in the subform.

I've tried using this in the row source type:

SELECT [Bid Table].BidName FROM [Bid Table] WHERE ((([Bid
Table].SaleUnitId)=[Bid Subform].SaleUnitID));

However, the combo box always prompts for the parameter of [Bid
Subform].SaleUnitID when clicked rather than recognizing what
SaleUnitID is currently being displayed in the subform.

Any input would be greatly appreciated. Thanks in advance.
 
G

Guest

Try changing your where statement to:
[Bid Table].SaleUnitId=[Bid Subform]!Form.SaleUnitID

Barry
 
D

Don

I really appreciate the advice. It is still prompting for the parameter
value. :-(


Barry said:
Try changing your where statement to:
[Bid Table].SaleUnitId=[Bid Subform]!Form.SaleUnitID

Barry

Don said:
I hope I can explain this thoroughly.

I have a main form that shows sale unit data for a particular
SaleUnitID. Within that form, I have a subform that allows the user to
enter bid data into a bid table linked by SaleUnitID.

I would like a combo box in the main form that, when dropped down,
allows the user to pick the winning bidder from the bidders who have
bid on the current SaleUnitID that is being displayed in the subform.

I've tried using this in the row source type:

SELECT [Bid Table].BidName FROM [Bid Table] WHERE ((([Bid
Table].SaleUnitId)=[Bid Subform].SaleUnitID));

However, the combo box always prompts for the parameter of [Bid
Subform].SaleUnitID when clicked rather than recognizing what
SaleUnitID is currently being displayed in the subform.

Any input would be greatly appreciated. Thanks in advance.
 
G

Guest

Is [Bid Subform] the name of your subform control? This might be different
from the name of the form it contains. Also, are you sure that everything is
spelled correctly? (Sorry. I have to ask :) )

Barry

Don said:
I really appreciate the advice. It is still prompting for the parameter
value. :-(


Barry said:
Try changing your where statement to:
[Bid Table].SaleUnitId=[Bid Subform]!Form.SaleUnitID

Barry

Don said:
I hope I can explain this thoroughly.

I have a main form that shows sale unit data for a particular
SaleUnitID. Within that form, I have a subform that allows the user to
enter bid data into a bid table linked by SaleUnitID.

I would like a combo box in the main form that, when dropped down,
allows the user to pick the winning bidder from the bidders who have
bid on the current SaleUnitID that is being displayed in the subform.

I've tried using this in the row source type:

SELECT [Bid Table].BidName FROM [Bid Table] WHERE ((([Bid
Table].SaleUnitId)=[Bid Subform].SaleUnitID));

However, the combo box always prompts for the parameter of [Bid
Subform].SaleUnitID when clicked rather than recognizing what
SaleUnitID is currently being displayed in the subform.

Any input would be greatly appreciated. Thanks in advance.
 
D

Don

[Bid Subform] is the name of both the form and the subform control. I
double checked the spelling and everything seems to be correct.

Don

Barry said:
Is [Bid Subform] the name of your subform control? This might be different
from the name of the form it contains. Also, are you sure that everything is
spelled correctly? (Sorry. I have to ask :) )

Barry

Don said:
I really appreciate the advice. It is still prompting for the parameter
value. :-(


Barry said:
Try changing your where statement to:
[Bid Table].SaleUnitId=[Bid Subform]!Form.SaleUnitID

Barry

:

I hope I can explain this thoroughly.

I have a main form that shows sale unit data for a particular
SaleUnitID. Within that form, I have a subform that allows the user to
enter bid data into a bid table linked by SaleUnitID.

I would like a combo box in the main form that, when dropped down,
allows the user to pick the winning bidder from the bidders who have
bid on the current SaleUnitID that is being displayed in the subform.

I've tried using this in the row source type:

SELECT [Bid Table].BidName FROM [Bid Table] WHERE ((([Bid
Table].SaleUnitId)=[Bid Subform].SaleUnitID));

However, the combo box always prompts for the parameter of [Bid
Subform].SaleUnitID when clicked rather than recognizing what
SaleUnitID is currently being displayed in the subform.

Any input would be greatly appreciated. Thanks in advance.
 
L

Larry Linson

Is this in the Query itself, or are you building the SQL in VBA code? What
are your main Form name and your Subform Control name (not the name of the
Form embedded in the Subform Control)?

Larry Linson
Microsoft Access MVP

Don said:
I really appreciate the advice. It is still prompting for the parameter
value. :-(


Barry said:
Try changing your where statement to:
[Bid Table].SaleUnitId=[Bid Subform]!Form.SaleUnitID

Barry

Don said:
I hope I can explain this thoroughly.

I have a main form that shows sale unit data for a particular
SaleUnitID. Within that form, I have a subform that allows the user to
enter bid data into a bid table linked by SaleUnitID.

I would like a combo box in the main form that, when dropped down,
allows the user to pick the winning bidder from the bidders who have
bid on the current SaleUnitID that is being displayed in the subform.

I've tried using this in the row source type:

SELECT [Bid Table].BidName FROM [Bid Table] WHERE ((([Bid
Table].SaleUnitId)=[Bid Subform].SaleUnitID));

However, the combo box always prompts for the parameter of [Bid
Subform].SaleUnitID when clicked rather than recognizing what
SaleUnitID is currently being displayed in the subform.

Any input would be greatly appreciated. Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top