Hello,
I have two forms, each has a combo-box “cb_samples” with the identical query. After a user selects an item from combobox on FormA and pressed a button “openFormB”, I would like FormA to close and FormB to open with the combobox showing the same item that was selected on FormA.
Here is what I’ve tried:
I get an error message “object doesn’t support this property of method”
How do I accomplish this?
Thanks, Mila
I have two forms, each has a combo-box “cb_samples” with the identical query. After a user selects an item from combobox on FormA and pressed a button “openFormB”, I would like FormA to close and FormB to open with the combobox showing the same item that was selected on FormA.
Here is what I’ve tried:
Code:
Private Sub cmb_FormB_open_Click()
Debug.Print Me.cb_samples.ListIndex ‘shows index of the selected item
DoCmd.OpenForm "FormB", acNormal, , , , , Me.cb_samples.ListIndex
DoCmd.Close
End sub
Private Sub Form_Open(Cancel As Integer) ‘open FormB
If Not IsNull(Me.OpenArgs) Then
Debug.Print Me.OpenArgs
Me!cb_samples.ItemData (Me.OpenArgs)
End If
End Sub
I get an error message “object doesn’t support this property of method”
How do I accomplish this?
Thanks, Mila