Solved Run a query to populate report and save report (1 Viewer)

Puff

New member
Local time
Today, 18:43
Joined
May 27, 2020
Messages
13
Hi All,

Thank you for all of the assistance given so far, I wonder if I could trouble you further please?

My project involves the user filling in a form, when they are finished, they submit the form, it is saved and off they go; feeling happy that they have submitted a report. Nothing new there I hear you shout - this is all up and running, but let's face it, a DB table is not very interesting to a group of users.

I would like to add an extra level, I have made a report which echoes the significant aspects of the user's form and have set the source property of this report to a query: “qry_tblReport”.

I can manually go to the criteria in this query and select the relevant “ID” number of the record I want to display and the report is populated, but I would like to set the report to display only the last record in the database, i.e. the record that the user has just created.

I would then, if possible, like to save the report as a .pdf and save a new report saved each time a user fills in a new record. The file save location will be constant, but obviously the file name will need to be different and generated by access / VBA.

The project will be used by people with less knowledge of access than myself, so the process of generating the report and saving it should require no input from them.

Is this possible and how would you go about doing it??

I should point out that I am a real novice when it comes to Access.

Thank you

Puff
 

Gasman

Enthusiastic Amateur
Local time
Today, 18:43
Joined
Sep 21, 2011
Messages
14,217
What happens if two users create records?
Might be better to get their record with max date and time for that user.?
That would involve having a field for Date&Time and User.?

I tend to have these fields in certain tables to see when created and who by and also when last modified and who by.?
Then a DoCmd.OutputTo with relevant data concatenated for the file name should do it.?

https://www.access-programmers.co.u...cess-report-to-pdf-using-vba-criteria.295792/
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 01:43
Joined
May 7, 2009
Messages
19,227
add a Date field to your table.
we will only print if the Date field is blank.
after printout, we set the Date field to today's date + time.

see the code on the Print Out button.
 

Attachments

  • printTest.zip
    53.1 KB · Views: 97

Puff

New member
Local time
Today, 18:43
Joined
May 27, 2020
Messages
13
Hi Gasman, thanks for your response.

Perhaps should have mentioned, the system is anonymous, although I could track user names, one of the principles is that it is a blameless system and a condition is that no action will be taken against anyone using it. No personally identifiable information is used.

It is perfectly acceptable (and desirable) for several users to submit a report on the same day
 

Gasman

Enthusiastic Amateur
Local time
Today, 18:43
Joined
Sep 21, 2011
Messages
14,217
Hi Gasman, thanks for your response.

Perhaps should have mentioned, the system is anonymous, although I could track user names, one of the principles is that it is a blameless system and a condition is that no action will be taken against anyone using it. No personally identifiable information is used.

It is perfectly acceptable (and desirable) for several users to submit a report on the same day
Yes, it would have helped. :(
arnelgp's solution would work in that case?
 

Puff

New member
Local time
Today, 18:43
Joined
May 27, 2020
Messages
13
Thank you Arnelgp - this is perfect and gets around the need to run a query, very much appreciated :)
 

Users who are viewing this thread

Top Bottom