Quarry


Hi, I have 2 Access Forms, Frm1 & Frm2. In Frm1 I have a cmd button which when clicked should open Frm2 and refresh a combo box in Frm2. How can this be done as the below is not working.

Private Sub cmd_cmp_Click()
DoCmd.OpenForm "frm2"
Me.frm2.Form.cbo_1.Refresh
End Sub




Re: Referencing objects from different reports

ADG


Hi

Try

Private Sub cmd_cmp_Click()

dim MyForm as Form
DoCmd.OpenForm "frm2"

set myForm=forms!frm2
myForm.cbo_1.Refresh

set myForm=nothing
End Sub






Re: Referencing objects from different reports

RobinChadwick

What data is the combo box showing What do you want the refresh to accomplish

When you refresh the form, it should refresh the fields within the form. It could be as simple as using:

DoCmd.OpenForm "frm2"

Me.Refresh