P
PeterM
I have a form with a subform. I need to set a control on the subform from a
control on the form. In the code below, contacts is the form,
contactsaddresses is the subform. ComboName is the name of the destination
subform control. SourceName is the name of the control on the form.
Access cries that it cannot find the field comboname. I need the value of
ComboName to be used, i.e. "FirstName".
below is how I call the procedure and the procedure itself. How do I use
the value of comboname in the call.. not the literal "comboname"
Private Sub combo43_AfterUpdate()
MoveContactToAddresses Combo43, "firstname"
End Sub
Private Sub MoveContactToAddresses(ComboName As String, SourceName As String)
[Forms]![contacts]![ContactsAddresses].Form!ComboName =
Me(SourceName).Value
End If
[Forms]![contacts]![ContactsAddresses].Form.Refresh
End Sub
control on the form. In the code below, contacts is the form,
contactsaddresses is the subform. ComboName is the name of the destination
subform control. SourceName is the name of the control on the form.
Access cries that it cannot find the field comboname. I need the value of
ComboName to be used, i.e. "FirstName".
below is how I call the procedure and the procedure itself. How do I use
the value of comboname in the call.. not the literal "comboname"
Private Sub combo43_AfterUpdate()
MoveContactToAddresses Combo43, "firstname"
End Sub
Private Sub MoveContactToAddresses(ComboName As String, SourceName As String)
[Forms]![contacts]![ContactsAddresses].Form!ComboName =
Me(SourceName).Value
End If
[Forms]![contacts]![ContactsAddresses].Form.Refresh
End Sub