Open record in subform from hyperlink click on 2nd subform? (1 Viewer)

hbrehmer

Member
Local time
Today, 15:03
Joined
Jan 10, 2020
Messages
66
Hi all,
It's a Monday and not enough coffee yet. I can't seem to figure this one out. It's probably very simple.

I have a main form with 3 subforms. Only one is an entry point, but another subform displays those entries as they are being entered. I want the user to be able to click on the list of entries to edit if necessary. I created a hyperlink on the field in the List subform. I have the code the open the form, but instead of just populating the record in the Entry form, it opens a new tab.

How can I get the OpenForm to just populate the subform instead of opening a whole new form?
 

theDBguy

I’m here to help
Local time
Today, 15:03
Joined
Oct 29, 2018
Messages
10,714
Hi. You won't use OpenForm on subforms. Instead, you would typically navigate the main form or subform to the desired record.
 

hbrehmer

Member
Local time
Today, 15:03
Joined
Jan 10, 2020
Messages
66
Hi. You won't use OpenForm on subforms. Instead, you would typically navigate the main form or subform to the desired record.
I figured, but what is the code? OpenRecord? I haven't used that one before, that is why I'm having an issue with this one.
 

theDBguy

I’m here to help
Local time
Today, 15:03
Joined
Oct 29, 2018
Messages
10,714
I figured, but what is the code? OpenRecord? I haven't used that one before, that is why I'm having an issue with this one.
Hi. To get an idea what the code looks like, try adding a Combobox using the Wizard and select the third option.
 

hbrehmer

Member
Local time
Today, 15:03
Joined
Jan 10, 2020
Messages
66
Ok. I need help. Here is what I have:

Private Sub TicketID_Click()
DoCmd.SearchForRecord , "subTktSchedule2", acFirst, "TicketID= " & Me.TicketID
End Sub

My TicketID is in subOpenOrders form and I want to open the record in subTktSchedule form. Both are sub forms on frmScheduleTicket. What am I missing?
 

theDBguy

I’m here to help
Local time
Today, 15:03
Joined
Oct 29, 2018
Messages
10,714
Ok. I need help. Here is what I have:

Private Sub TicketID_Click()
DoCmd.SearchForRecord , "subTktSchedule2", acFirst, "TicketID= " & Me.TicketID
End Sub

My TicketID is in subOpenOrders form and I want to open the record in subTktSchedule form. Both are sub forms on frmScheduleTicket. What am I missing?
Hi. Are you able to post a sample copy of your db with test data?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom