As of now, I have tried to implement this and as I select any value from the first combobox of row 1 I see the second combobox of the same row gets populated but as I go on selecting values from the first set of comboboxes I see that the values in the second set of the comboboxes above changing or becoming null.
Here's the code:
The 1st combobox is cboRCMTask:
Expand|Select|Wrap|Line Numbers
- Private Sub cboRCMTask_AfterUpdate()
- Me.cboRCMTaskOptions.RowSource = "SELECT ID, RCMTaskOptions FROM tblRCMTaskOptions WHERE RCM_ID=" & Me.cboRCMTask.Column(0) & ";"
- Me.cboRCMTaskOptions = Me.cboRCMTaskOptions.ItemData(0)
- Me.cboRCMTaskOptions.Requery
- End Sub
The form_current event:
Expand|Select|Wrap|Line Numbers
- Private Sub Form_Current()
- Me.cboRCMTask.RowSource = "SELECT ID, RCMTask FROM tblRCMTask;"
- If IsNull(txtRCM_ID) Then
- Me.cboRCMTask = Me.cboRCMTask.ItemData(0)
- 'Me.cboRCMTask = Null
- End If
- Me.cboRCMTaskOptions.RowSource = "SELECT ID, RCMTaskOptions FROM tblRCMTaskOptions WHERE RCM_ID=" & Me.cboRCMTask.Column(0) & ";"
- If IsNull(txtRCMOption_ID) Then
- Me.cboRCMTaskOptions = Me.cboRCMTaskOptions.ItemData(0)
- End If
- End Sub