Populate a listbox

G

Guest

I have a textbox (cbPONbr) on a subform (frmPO) on a tab of a tabbed main
form. On the same tab, but a not in the subform, I have a list box. I want
the listbox to be populated by a query that uses tbPONbr in its where clause.

SELECT tbltransactions.transnbr, tbltransactions.qty FROM tbltransactions
WHERE tbltransactions.transnbr=form!tbPONbr;

Can't get it to select any records. I'm not sure when it requeries. I can't
be sure it's even being parsed, though I get no error messages, only a blank
listbox with correct headings. I want it to requery every time the user
changes the tbPONbr query.

Where am I going wrong?
 
G

Guest

Boy oh boy. I just typed in 5 paragraphs and then MSDN decided to
authenticate me and lost it all...aaaarrrrggghhhh

Your reply solved my easy problem. I had two issues, and that's why the
confusion on text box, combo box, etc.

On the second issue, here's the situation:

I have a form called PrivChoiceForm. It has a tab control on it, and I'm
interested in tab 2.

Tab 2 has a subform whose definition is frmPurchaseOrders. On the property
sheet, it doesn't seem to have a name...curious.

In the header of frmPurchaseOrders, I have tbPONbr (unbound). In the detail
section, the control source for the data entry sheet is tblTransactions.

On the same tab (Tab2), I have lbExistingPO. I want its record source to
depend on a where clause referring to tbPONbr from that other subform
(frmPurchaseOrders).

If that's not clear as mud, I don't know what else to do...wish you could
take HTML so I could show it visually...
 
G

Guest

JimS said:
Boy oh boy. I just typed in 5 paragraphs and then MSDN decided to
authenticate me and lost it all...aaaarrrrggghhhh

Your reply solved my easy problem. I had two issues, and that's why the
confusion on text box, combo box, etc.

On the second issue, here's the situation:

I have a form called PrivChoiceForm. It has a tab control on it, and I'm
interested in tab 2.

Tab 2 has a subform whose definition is frmPurchaseOrders. On the property
sheet, it doesn't seem to have a name...curious.
It has a name, you just need to look in the right place. My guess is if
you look at the subform control, it's name is frmPurchaseOrders. You find
the name of the form that is being used as the subform in the Source Object
property of the subform control.
In the header of frmPurchaseOrders, I have tbPONbr (unbound). In the detail
section, the control source for the data entry sheet is tblTransactions.
Header/Detail? is this a subform within a subform?
On the same tab (Tab2), I have lbExistingPO. I want its record source to
depend on a where clause referring to tbPONbr from that other subform
(frmPurchaseOrders).
What is lbExistingPO? Is it another subform?
 
G

Guest

Alright. I figured it out. Why can't the IDE have a property item called
"fully qualified name" or some such, even at run time? Most times, the fully
qualified name is discernable by the IDE at design time...why not save us
poor workin' folks a little time?

Thanks Klatuu!
 

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