P
Phil
Hi all,
I'm about to chew off my arm for this one, because it's
probably pretty simple and I'm just not seeing it or
finding past articles on it...
I want to refer to a control on an open form in order to
requery the control, and I using something very similar
to the example code given in the help. Here is the
example code in MS Access help:
Public Sub RequeryList()
Dim ctlCombo As Control
' Return Control object pointing to a combo box.
Set ctlCombo = Forms!Employees!ReportsTo
' Requery source of data for list box.
ctlCombo.Requery
End Sub
And here is my code:
Dim ctl as Control
Set ctl = Form![frmPatientRecord].Controls
[Me.txtHiddenControl)
ctl.Requery
The only real difference is that I want to refer to a
control that I pass into the current form, so the
Me.txtHiddenControl is a string value that is also the
name of a control on the form frmPatientRecord.
What I keep getting ctl set to is the value of the
control on the open form, not actually the control itself.
What am I not understanding?
I'm about to chew off my arm for this one, because it's
probably pretty simple and I'm just not seeing it or
finding past articles on it...
I want to refer to a control on an open form in order to
requery the control, and I using something very similar
to the example code given in the help. Here is the
example code in MS Access help:
Public Sub RequeryList()
Dim ctlCombo As Control
' Return Control object pointing to a combo box.
Set ctlCombo = Forms!Employees!ReportsTo
' Requery source of data for list box.
ctlCombo.Requery
End Sub
And here is my code:
Dim ctl as Control
Set ctl = Form![frmPatientRecord].Controls
[Me.txtHiddenControl)
ctl.Requery
The only real difference is that I want to refer to a
control that I pass into the current form, so the
Me.txtHiddenControl is a string value that is also the
name of a control on the form frmPatientRecord.
What I keep getting ctl set to is the value of the
control on the open form, not actually the control itself.
What am I not understanding?