Refresh Data of Combo Box on a Subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a combo box on a subform. If it's new data, it will open another
form and let users input the new data. After that, the new data cannot be
shown in the itemdata of the combo box. I use Requery for the combo box. It
works fine when the form is not linked to any forms. How can I refresh the
new item data on a subform?

Thanks in advance,
Kit Lau
 
Try:

Forms.[NameOfYourMainForm].[NameOfYourSubformControl].Form.[NameOfYourCombo].Requery
 
I tried that on OnClick event but it doesnt work. Any idea?

Allen Browne said:
Try:

Forms.[NameOfYourMainForm].[NameOfYourSubformControl].Form.[NameOfYourCombo].Requery

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Kit Lau said:
I have a combo box on a subform. If it's new data, it will open another
form and let users input the new data. After that, the new data cannot
be
shown in the itemdata of the combo box. I use Requery for the combo box.
It
works fine when the form is not linked to any forms. How can I refresh
the
new item data on a subform?

Thanks in advance,
Kit Lau
 
Set the On Click property to:
[Event Procedure]
Click the Build button (...) beside this.
Access opens the code window.
Enter the line there, between the "Private Sub..." and "End Sub" lines.

If that still fails, open your main form in design view.
Right-click the edge of the subform control, and choose Properties.
What is the Name of the subform control?
It may be different from its SourceObject (the name of the form that is
loaded into the subform control).

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Kit Lau said:
I tried that on OnClick event but it doesnt work. Any idea?

Allen Browne said:
Try:

Forms.[NameOfYourMainForm].[NameOfYourSubformControl].Form.[NameOfYourCombo].Requery

--

Kit Lau said:
I have a combo box on a subform. If it's new data, it will open
another
form and let users input the new data. After that, the new data
cannot
be
shown in the itemdata of the combo box. I use Requery for the combo
box.
It
works fine when the form is not linked to any forms. How can I refresh
the
new item data on a subform?

Thanks in advance,
Kit Lau
 
Back
Top