Make a field on a report Visible when a field on a form is updated and Visaversa

angoni6

New member
Local time
Today, 06:57
Joined
Apr 18, 2016
Messages
7
Hello
I would like to make a filed on a report visible if a certain field on the form is updated and invisible if the field on the form is not updated. Am new to MS access programing
Thank you in advance
 
your solution for the report depends in whether your report is continuous or single. If the former, you can use conditional formatting - note you cannot hide a control but you can format its back and fore colours to blend in with the background. If the latter, you can use either conditional formatting as form continuous reports or vba code to set the controls visible property to false.

You say the condition is based on a value on a form, so consider using the openargs parameter of the openreport command to pass the value to the report.

you haven't provided an real information to suggest a solution so to find out more google the following or similar 'access conditional formatting', 'access openargs', 'access openreport' , 'access open event', 'access control afterupdate event'. This should enable you to work out what is best for you - if you have any problems with the code, then come back
 
Thank you very much CJ London for a quick reply
I a trying to develop an app for sending weather reports to radio stations (am a newbie in VBA). One of the fields on the form is Warning, This is where extreme warnings such as Strong winds Heavy thunderstoms are put. In cases where we have fair weather this is not important and thats when I don''t want the field to appear on the report which is sent to the radio stations. I wrote something like this of the afterUpdate

Private Sub Warning_AfterUpdate()
If Me.Warning.Value = -1 Then
Reports![radioweather]![Warning].Visible = True
End If
End Sub

The reports are not continuous.
 
Assuming the report is opened after this field has been updated, then I would pass the value via openargs

docmd.OpenReport "radioweather",,,,,me.warning

then in your report format event put

warning.visible=me.openargs
 
My Intention is not to respond to this thread but cant see where to post a new thread:banghead: Where do I post new thread please
 
on any of the forums (e.g. queries) you will finds the New Thread button on the left between the menu bar and the list of threads.
attachment.php
 

Attachments

  • Capture.JPG
    Capture.JPG
    74.9 KB · Views: 601

Users who are viewing this thread

Back
Top Bottom