Run a Single Report (1 Viewer)

Simonhtc4

New member
Local time
Today, 13:04
Joined
Apr 27, 2016
Messages
8
Afternoon(UK Time) Guys and Girls,

Im a novice at Access and require your vast knowledge.
Im building a Databse and having problems with running a Report.

Im really struggling with this and im sure its very easy:confused:

Where to start:

1. If you open the Certificates_frm and select Run All certificates it does what it says on the tin and Open the Certificates_rpt for everything thats in the Certificates_qry.

2. If i select run Single Certificate it will take you to the SingleCertificate_frm

3. i would like to create a Combo box to select a plantation from the Bidwell_tbl and display all its detail in the Certificates_rpt

I have tried VBA:

A. DoCmd.OpenReport "Certificates_rpt", acViewPreview, , "ID_No = " & Me!Plantation (Failed):banghead:

B:Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
DoCmd.OpenReport "Certificates_rpt", acViewPreview, , , acWindowNormal
End If (Failed):banghead:

Can anyone help please?

Regards
Simon
 

Attachments

  • Bidwell.zip
    182.2 KB · Views: 74

isladogs

MVP / VIP
Local time
Today, 13:04
Joined
Jan 14, 2017
Messages
18,216
Seems a convoluted way of doing things but easy enough to achieve
I've added a combo box & button to the single certificate form
Also added Id_No field to the query so it can be referenced when opening the report using:

Code:
DoCmd.OpenReport "Certificates_rpt", acViewPreview, , "ID_No = " & Me.cboPlantation

Suggest you change your naming convention
Avoid underscores as well as spaces to make life much easier

Better to use e.g. rptCertificates; frmCertificates; tblPlantations etc

Updated version of db attached
 

Attachments

  • Bidwell.accdb
    1 MB · Views: 77
Last edited:

Simonhtc4

New member
Local time
Today, 13:04
Joined
Apr 27, 2016
Messages
8
Ridders, thanks you very much good sir.
Ill take the points and pass them onto the next Databse i build.
 

isladogs

MVP / VIP
Local time
Today, 13:04
Joined
Jan 14, 2017
Messages
18,216
Glad to have helped.
If its what you wanted, perhaps you could click the Thumbs up button!

And its not too late to change the names at this stage!
 

Users who are viewing this thread

Top Bottom