New Guy said:
I want to change the Link Child Fields on a subform using Code based on a
checkbox value (0,-1). Can this be done?
Select unbound Chkbox on form and have value in Link Child Fields change
FROM NumberID TO JNumberID. Any ideas or samples appreciated.
Try this one:
Private Sub Trip_Click()
strmainform = Me.Form.Name
strSubformcontrol = "varform"
strControlname = "frmhistory"
strChildFields = "tabTripHeaderID"
strMasterFields = "tabTripHeaderID"
strRecordsource = "qryTrip"
Call MainFormLoaded(Me.Form.Name)
If MainFormLoad = True Then
Call displayVarform(strmainform, strSubformcontrol, strControlname,
strChildFields, strMasterFields, strRecordsource)
Call bindvarform(strmainform, strSubformcontrol)
Else
strChildFields = ""
strMasterFields = ""
strRecordsource = ""
Call displayVarform(strmainform, strSubformcontrol, strControlname,
strChildFields, strMasterFields, strRecordsource)
Call unboundvarform(strmainform, strSubformcontrol)
End If
Call CalcTotalWeight(strmainform, strSubformcontrol)
'Call varFormEdit(strMainForm, strSubformControl, strControlName, frmState)
'Forms(strMainForm)(strSubformControl).AllowAdditions = False
End Sub