Unanswered: push colm 1 & colm 2 values from cbo to sub form txtboxes
i have a form with a combo box, it has 2 fields the 1st is hidden the second is visible
I would like to take the 2 values and put them into 2 txtboxes on my sub form, the subform is set to data entry, there is currently no data in the subform table, i would like to filter the subform if there are any records, or add a new rec if the ID from the cbo doesnt exist in the subform table
i would like to filter the subform if there are any records, or add a new rec if the ID from the cbo doesnt exist in the subform table
Whoa...first you want to fill the contents of two fields within the SubForm which in essense is starting a new record (no?) .... then you want to Filter the SubForm for Records? I'm a wee bit confused but then again....that's just me.
OK, I'm gonna take a poke at it....
If Nz(DLookUp("[SubFormTableID]", "[SubFormTable]", "[SubTableID]=" & _
Me.myComboBoxName.Column(0)), 0) > 0 Then
Forms("youMainFormName")("yourSubFormControlName").Form.RecordSource = _
"SELECT * FROM mySubFormTableName WHERE SubFormTableID=" & _
Me.myComboBoxName.Column(0) & ";"
Dim Ctrl1 As Control, Ctrl2 As Control
Ctrl1 = Forms("youMainFormName")("yourSubFormName").Form.TheFirstControlNameInSubForm
Ctrl2 = Forms("youMainFormName")("yourSubFormName").Form.TheSecondControlNameInSubForm
Ctrl1 = Me.myComboBoxName.Column(0)
Ctrl2 = Me.myComboBoxName.Column(1)
Self Taught In ALL Environments.....And It Shows!