Solved Click on listbox item and requery report on subform? (1 Viewer)

inkbird01

New member
Local time
Today, 07:30
Joined
Oct 5, 2022
Messages
20
Hi,

I have a form with a subform. On this subform i have a report and a list box.I want to be able to click on the listbox item and then display the record details in the report.

I have tried this code:

DoCmd.OpenReport "Report", acViewPreview, "[ID] =" & lst_Items.Column(0)

but because the report is on the subform, i dont want to "OpenReport" / populate a report - i want the report on the subform to refresh based on the listbox selection

Thank you so much
 

Attachments

  • 2023-05-17_8-42-18.jpg
    2023-05-17_8-42-18.jpg
    42.2 KB · Views: 56

Josef P.

Well-known member
Local time
Today, 08:30
Joined
Feb 2, 2023
Messages
826
Connect the subreport to the listbox.

LinkMasterFields: YourListbox
LinkChildFields: ID
 

inkbird01

New member
Local time
Today, 07:30
Joined
Oct 5, 2022
Messages
20
Connect the subreport to the listbox.

LinkMasterFields: YourListbox
LinkChildFields: ID
Thanks for your reply but i get an error " Can't build a link between unbound forms "
 

Users who are viewing this thread

Top Bottom