T
tompk
I have a form (Frm_RTP_MAIN) with a continuous subform (Frm_MAIN_MULTIPLES)
that has a search button on it. It opens a search form that allows the user
to search the main table records and highlight the record they want to add.
I have the code pasted below that I have used in other search forms (which
are not continuous and open a main form instead of a subform).
When I use this code, it opens the form but I actually want it to insert the
record into the row in the continous subform inside the main form. And then
continue searching and adding records as many times as they need to. There
is an Add button to for when their search comes up null.
I am terrible at code and have tried a few different options such as
[Frm_RTP_MAIN]![Frm_MAIN_MULTIPLES] but can't seem to get it to work. I was
thinking maybe it's actually the OpenForm that is wrong.
Private Sub List_Results_DblClick(Cancel As Integer)
'Open MAIN_Form based on the ID from List_Results listbox
DoCmd.OpenForm "Frm_MAIN_MULTIPLES", , , "[Record_ID] = " &
Me.List_Results, , acDialog
DoCmd.Close acForm, Me.Name
End Sub
Any help is greatly appreciated!
that has a search button on it. It opens a search form that allows the user
to search the main table records and highlight the record they want to add.
I have the code pasted below that I have used in other search forms (which
are not continuous and open a main form instead of a subform).
When I use this code, it opens the form but I actually want it to insert the
record into the row in the continous subform inside the main form. And then
continue searching and adding records as many times as they need to. There
is an Add button to for when their search comes up null.
I am terrible at code and have tried a few different options such as
[Frm_RTP_MAIN]![Frm_MAIN_MULTIPLES] but can't seem to get it to work. I was
thinking maybe it's actually the OpenForm that is wrong.
Private Sub List_Results_DblClick(Cancel As Integer)
'Open MAIN_Form based on the ID from List_Results listbox
DoCmd.OpenForm "Frm_MAIN_MULTIPLES", , , "[Record_ID] = " &
Me.List_Results, , acDialog
DoCmd.Close acForm, Me.Name
End Sub
Any help is greatly appreciated!