Objects visible vs. Not Visible by condition

G

Guest

Hello. I have a wonderful project to complete. I am trying to maximize my
efforts by combining several reports into 1. To do this I need to set
objects on my report... ie text boxes and images to display based on a value
on a record. I have two types of records... typeA and typeB. How is it that
I can display a text box bases off a value of "TypeA" and Hide "Type B"? I
think there is a way using a control such as me.visible... but I'm not a
programmer... can anyone help. Thank you in advance!
 
M

Marshall Barton

Chefjay22 said:
Hello. I have a wonderful project to complete. I am trying to maximize my
efforts by combining several reports into 1. To do this I need to set
objects on my report... ie text boxes and images to display based on a value
on a record. I have two types of records... typeA and typeB. How is it that
I can display a text box bases off a value of "TypeA" and Hide "Type B"? I
think there is a way using a control such as me.visible... but I'm not a
programmer... can anyone help.

If each record has a field that has the type of the record,
then the code could simply be like:

Mw.textbox.Visible = (typefield = "A")
 
G

Guest

Marsh,

Thanks for the reply. Where is the best place to put this code? On
FormOpen? So Basically for what I am doing I have a text box named txtFord
and I want it visible when the record = "Ford" but not when the record is
Chevy... so will this work:

Me.txtFord.Visible = (Make = "Ford")

Am I on the right track?


Jason
 
M

Marshall Barton

Generall that line of code belongs in the Format event
procedure of the section with the text box, txtFord.

The code you posted looks good as long as Make is a Text
field in its table abd some records contain "Ford"
 
G

Guest

Awesome... I'll get on that before I head home. Thanks!

Marshall Barton said:
Generall that line of code belongs in the Format event
procedure of the section with the text box, txtFord.

The code you posted looks good as long as Make is a Text
field in its table abd some records contain "Ford"
--
Marsh
MVP [MS Access]

Thanks for the reply. Where is the best place to put this code? On
FormOpen? So Basically for what I am doing I have a text box named txtFord
and I want it visible when the record = "Ford" but not when the record is
Chevy... so will this work:

Me.txtFord.Visible = (Make = "Ford")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top