Hello
This is my first post on the forum so hello everyone.
I have a problem with access that I can't manage to view the current form record as a report ready to be printed.
I have a list of clients that when viewed in a form, i need to be able to generate a letter with their details already filled in.
I've tried various version of the same code to try to achieve this, but all it can do is pull out and fill in the report for the first record of the client list.
DoCmd.OpenReport "courseLetter", acViewPreview, , _
'"[client_client_id] = " & Me.client_id
DoCmd.OpenReport "courseLetter", acViewPreview, , "client_client_id=Forms!Me!client_id"
DoCmd.OpenReport "courseLetter", acViewPreview, , "[client_client_id] = " & Me![client_id]
DoCmd.OpenReport "courseLetter", acViewPreview, , "[client_client_id] = " & Me!client_id
The client_id is called client_client_id on the report.
This is the current SQL for the report (found in the properties panel)
SELECT [client].[client_name], [client].[client_id] AS client_client_id, [contacts].[contact_id], [contacts].[contact_title], [contacts].[contact_name], [contacts].[contact_sub_premises_name], [contacts].[contact_premises_name], [contacts].[contact_thoroughfare_no], [contacts].[contact_thoroughfare_name], [contacts].[contact_locality], [contacts].[contact_town], [contacts].[contact_county], [contacts].[contact_postcode], [contacts].[contact_telephone], [contacts].[contact_mobile], [contacts].[contact_fax], [contacts].[contact_web_address], [contacts].[contact_email], [contacts].[client_id] AS contacts_client_id, [courses].[course_id], [courses].[course_title], [courses].[client_id] AS courses_client_id FROM (client INNER JOIN courses ON [client].[client_id]=[courses].[client_id]) INNER JOIN contacts ON [client].[client_id]=[contacts].[client_id];
I hope you geniouses can help me on this matter as I'm fresh out of solutions!
Thanks in advance
David