I have a from "Form1" that has a subform "frmInfosub". Sub form has a combo
box to select a vendor. If the vendor is not in the list the can click on
<New> and it will open the add vendor form. When that form closes I would
like the Vendor name combo on my subform to display the vendor that was just
entered. I am having a problem getting the coding right for this.
I know that if the field was just on the mainform it would look like this
Forms!Form1.cboVendor.Refresh
However I am not sure how to code for an item on a subform
thanks.
rm - 30 Jun 2008 17:01 GMT
This is a "rough" estimate based on memory and the fact that I had
trouble with this too... Look in the help file - there is a topic in
there about this exact issue. I think that you have to set focus on
the sub form then requery.
On the other hand you can create a public function in the sub form
with a line to requery the combo box on the sub form. I am no so sure
that that would be the cleanest approach though.
> I have a from "Form1" that has a subform "frmInfosub". Sub form has a combo
> box to select a vendor. If the vendor is not in the list the can click on
[quoted text clipped - 9 lines]
>
> thanks.
Douglas J. Steele - 30 Jun 2008 17:19 GMT
Assuming that the name of the subform control on Form1 is named frmInfosub,
you'd use
Forms!Form1!frmInfosub.Form!cboVendor
Depending on how you added frmInfosub as a subform, though, the name of the
control on Form1 may be different. If it is, use the name of the control
rather than frmInfosub.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
>I have a from "Form1" that has a subform "frmInfosub". Sub form has a combo
> box to select a vendor. If the vendor is not in the list the can click on
[quoted text clipped - 10 lines]
>
> thanks.