PC Review


Reply
Thread Tools Rate Thread

Change unbound text box in Report using VBA language from form

 
 
Melissa
Guest
Posts: n/a
 
      5th May 2010
I'm wondering if it is possible to change the contents of an unbound text box
in a Report by using VBA language from a Form.

Here's what I'm trying to do: When the user clicks on an Open Report
button, I would like the user to be able to choose if certain text is
displayed on the report or not. Then the Report should open. The certain
text I'm referring to is only saved in the VB code I've used in the Form that
he Open Report button is on. I can send code or give specifics if necessary,
but I was hoping that there was a simple solution that I was overlooking.
--
Thanks, and as always, I greatly appreciate all the support on this site.
Couldn't have done it without all your help.
 
Reply With Quote
 
 
 
 
vanderghast
Guest
Posts: n/a
 
      5th May 2010
From VBA, you can access a control on an open form with the syntax:
Forms!FormName!ControlName, so, basically, you can, in the procedure
handling the Report Open event, you can check the controls of the form, and
turn on or off the visibility of some controls in the report, as example:



Private Sub Report_Open(Cancel As Integer)
If Forms!formOne!ShowLabel6.Value <> "OK" Then Me.Label6.Visible = False
End Sub



So, basically, it is (easier if it is) the report which does the
synchronization, not the form.

Note that you can write additional code, in the report, to check if the form
is actually open (and if not, bypass the code about it).


Vanderghast, Access MVP

"Melissa" <(E-Mail Removed)> wrote in message
news:32C2469C-1D20-48F9-93E9-(E-Mail Removed)...
> I'm wondering if it is possible to change the contents of an unbound text
> box
> in a Report by using VBA language from a Form.
>
> Here's what I'm trying to do: When the user clicks on an Open Report
> button, I would like the user to be able to choose if certain text is
> displayed on the report or not. Then the Report should open. The certain
> text I'm referring to is only saved in the VB code I've used in the Form
> that
> he Open Report button is on. I can send code or give specifics if
> necessary,
> but I was hoping that there was a simple solution that I was overlooking.
> --
> Thanks, and as always, I greatly appreciate all the support on this site.
> Couldn't have done it without all your help.


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do you unbound text from form to report =?Utf-8?B?Sm9l?= Microsoft Access Forms 3 21st Dec 2005 10:00 PM
How can I change text in a report from code in a form. =?Utf-8?B?QWRkL0FwcGVuZCBDdXJyZW50IFJlc2lkZW50IHRv Microsoft Access Form Coding 1 21st Oct 2005 04:04 PM
Trigger event on change to unbound text in unbound form programmat =?Utf-8?B?QWJlUg==?= Microsoft Access Forms 5 6th Jan 2005 07:33 PM
Unbound Report Text Box Peter Nunez Microsoft Access Reports 1 3rd Nov 2003 06:19 PM
Default Value for unbound text box and unbound form: 1 Microsoft Access Form Coding 0 3rd Sep 2003 02:03 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:11 AM.