Requery where does it go?

HJC

New Member
Joined
May 13, 2002
Messages
33
I have a mainform [Customers] from table Customers
with a subform [Phones] from table CustandPhone.

Each customer may have several phone numbers so on the subform I have a combobox that shows all the phone numbers associated with the Customer.

It works fine for the first record on the main form but if I scroll through the customer records the combo box does not update. I know I need some kind of requery event but I am not exactly sure which field/what event I am looking for...

this is what populates the combo box in the subform

SELECT CustandPhone.CUSTID, CustandPhone.PhoneNo
FROM CustandPhone
WHERE
(((CustandPhone.CUSTID)=[forms]![Customers]![phones].[form]![CUSTID]));

any direction would be appreciated
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
In the form's Current event, put something like...
MyCombo.Requery

Form_Current fires each time you switch to another record.

You can also requery on the combo's Enter event if you prefer; in that case, don't worry about the Current event

Denis
 
Upvote 0

Forum statistics

Threads
1,214,782
Messages
6,121,532
Members
449,037
Latest member
tmmotairi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top