Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 430
  • Last Modified:

access subform-printing one record

I have one table Clients and this has a relationship to Files.
One client can have many files.

I have a subform Files on the main form Clients


What I would like to do to is to print the contents of one record of the sub form.

I need to make a report, prob based on a query and then have a filter in the report to filter one client AND that particular file
So as to print all the clients details and the details for ONE file.
Ideally select the file record from a double click from the file records.

Assistance please appreciated.
0
topUKlawyer
Asked:
topUKlawyer
  • 2
2 Solutions
 
Rey Obrero (Capricorn1)Commented:
you just need to add filter to your report record source

where [client]=Forms!MainForm!Client and [File] =Forms!MainForm!SubformControlName.Form.[File]
0
 
Jeffrey CoachmanCommented:
Create a report based on the files Table

Put a button on the  subform to print the report based on the selected "File"
Code would be something like this:

Private Sub Command0_Click()
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "rptFiles", acViewPreview, , "FileID=" & Me.FileID
End Sub

JeffCoachman
0
 
Jeffrey CoachmanCommented:
Something like this:
Database181.mdb
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now