I have a main form (called Rooms Available) with a listbox (called list0) in it.
There is a subform(called Room subform) in the main form.
The subform has a textbox (called roomno) in it.
The listbox displays a query. The code needs to copy the selected data in the listbox when the user clicks on the listbox and put that data into the textbox.
I want to use:
Private Sub List0_Click()
Me.ReferToTextboxInSubform = Me.List0
End sub
The problem is I do not know how to refer to the textbox in the subform. I know the syntax is:
Forms![main form name]![subform control name].Form![control name]
But either it wont work with the Me or im doing it wrong. I tried:
Me.Forms![Rooms Available]![Room subform].Form![Roomno] = Me.List0
This gives an error "method or data member not found"
Can you please tell me the correct code?
There is a subform(called Room subform) in the main form.
The subform has a textbox (called roomno) in it.
The listbox displays a query. The code needs to copy the selected data in the listbox when the user clicks on the listbox and put that data into the textbox.
I want to use:
Private Sub List0_Click()
Me.ReferToTextboxInSubform = Me.List0
End sub
The problem is I do not know how to refer to the textbox in the subform. I know the syntax is:
Forms![main form name]![subform control name].Form![control name]
But either it wont work with the Me or im doing it wrong. I tried:
Me.Forms![Rooms Available]![Room subform].Form![Roomno] = Me.List0
This gives an error "method or data member not found"
Can you please tell me the correct code?