Tick box to include graph within a report? (1 Viewer)

RussellDeano

Registered User.
Local time
Yesterday, 23:33
Joined
Aug 19, 2017
Messages
22
Good evening,

1. Is it possible to add a tick box to my search form with the option of including a graph in the report or not?

2. How do i change the specific date search function to a between dates function?

(I don't yet have the competency to work with SQL etc so have build the attached through wizards)

I have included a picture of my basic search form and also the report (some fields blurred out due to data protection)


Capture.JPG

Capture1.jpg
 

plog

Banishment Pending
Local time
Today, 01:33
Joined
May 11, 2011
Messages
11,661
1. Yes. You would use VBA to set the charts Visible property to Yes/No based on that tick box.

2. You would add another Date box and rename them to 'After Date:' and 'Before Date:'.
 

RussellDeano

Registered User.
Local time
Yesterday, 23:33
Joined
Aug 19, 2017
Messages
22
Excellent thank you,

Do you know of any links or tutorials i could view to walk me through the processes? Apologies i have only been working with Access for 3 weeks now.

Thank you again

1. Yes. You would use VBA to set the charts Visible property to Yes/No based on that tick box.

2. You would add another Date box and rename them to 'After Date:' and 'Before Date:'.
 

isladogs

MVP / VIP
Local time
Today, 07:33
Joined
Jan 14, 2017
Messages
18,252
Yes it is possible.

Use the checkbox to assign the arguments for opening your report
Checkbox ticked => arg ="chart"

In code to open your report use

Code:
 if me.checkbox=true then
DoCmd.OpenReport "ReportName",,,,,,"chart"
Else
DoCmd.openreport "ReportName"
End if

Then in your report load event, add code like

Code:
 If Me.openargs= "Chart" then
Me.chart.visible=true
Else
Me.chart.visible=false
End if

EDIT:
Just realised I'd forgotten to answer the other point in your post and saw plog got there first....
 

RussellDeano

Registered User.
Local time
Yesterday, 23:33
Joined
Aug 19, 2017
Messages
22
Thank you so much for your helpful reply,

Could i trouble you a little further?

Having never dealt with the code side of Access before, where within the code should the below be placed?

My search form code simply is:

Code:
Option Compare Database

And the code on my report is:

Code:
Option Compare Database

Private Sub Command38_Click()

End Sub

Yes it is possible.

Use the checkbox to assign the arguments for opening your report
Checkbox ticked => arg ="chart"

In code to open your report use

Code:
 if me.checkbox=true then
DoCmd.OpenReport "ReportName",,,,,,"chart"
Else
DoCmd.openreport "ReportName"
End if

Then in your report load event, add code like

Code:
 If Me.openargs= "Chart" then
Me.chart.visible=true
Else
Me.chart.visible=false
End if

EDIT:
Just realised I'd forgotten to answer the other point in your post and saw plog got there first....
 

Users who are viewing this thread

Top Bottom