make a text box visible and non visible

U

umpire_43

Hi there,

Hopefully, someone can help me with this.

Is there a way of making a text box visible through a if then statement on a
form if it meets a certain condition. ( using Control Sources function on the
property box)

for example.

Make the text box visible if not equal to zero else change the visible
property to not being visible.

Or is there another way of accomplishing the same thing using the property
box conditions or something else


I hope this makes sense.

Thanks
 
K

Klatuu

What you want to do is easy enough, but how will you get data into the text
box?

Based on your descripton, I would use the form Current event:

Me.MyTextBox.Visible = Me.MyTextBox <> 0
 
U

umpire_43

Hi thanks for your quick reply.

Im using dlooup under the control source to pull the information into the
text box. So i want to replace HELP ( in formula below)....will that work? I
hope that makes sense?

=IIf(DLookUp("[Quarterly Charge -Back]","Target Data","
Code:
   ='" &
[Basis 1 Code] & "'")=0,"help",DLookUp("[Quarterly Charge -Back]","Target
Data","  [Code]   ='" & [Basis 1 Code] & "'"))

Thanks
 
K

Klatuu

No, the code would not work there. Using this as the control source:
=DLookUp("[Quarterly Charge -Back]","[Target Data]","
Code:
   ='" &
Me![Basis 1 Code] & "'")

The use the code I posted earlier in the Form Current event. Note I put
brackets around Target Data.  When you put characters in a name that should
not be in a name (like a space), you need to bracket it so Access doesn't get
confused.  You code assumes:
You want to return the value in a field (poorly) named [Quarterly Charge
-Back]
The field is in a domain (table/query) (poorly) named [Target Data]
You are looking for a record where the field [Code] is equal to a control on
your form (poorly) named [Basis 1 Code]

--
Dave Hargis, Microsoft Access MVP


[QUOTE="umpire_43"]
Hi thanks for your quick reply.

Im using dlooup  under the control source to pull the information into the
text box. So i want to replace HELP ( in formula below)....will that work?  I
hope that makes sense?

=IIf(DLookUp("[Quarterly Charge -Back]","Target Data","  [Code]   ='" &
[Basis 1 Code] & "'")=0,"help",DLookUp("[Quarterly Charge -Back]","Target
Data","  [Code]   ='" & [Basis 1 Code] & "'"))

Thanks

[QUOTE="Klatuu"]
What you want to do is easy enough, but how will you get data into the text
box?

Based on your descripton, I would use the form Current event:

Me.MyTextBox.Visible = Me.MyTextBox <> 0[/QUOTE][/QUOTE]
 
U

umpire_43

Hi Dave,

I'm real sorry being a pest. Where am i suppose create the current event.
I don't see anything in the property dialog box that would get me started
when i right click on txtchargeback text box.

Am i missing something here?

Sorry

Keith



Klatuu said:
No, the code would not work there. Using this as the control source:
=DLookUp("[Quarterly Charge -Back]","[Target Data]","
Code:
   ='" &
Me![Basis 1 Code] & "'")

The use the code I posted earlier in the Form Current event. Note I put
brackets around Target Data.  When you put characters in a name that should
not be in a name (like a space), you need to bracket it so Access doesn't get
confused.  You code assumes:
You want to return the value in a field (poorly) named [Quarterly Charge
-Back]
The field is in a domain (table/query) (poorly) named [Target Data]
You are looking for a record where the field [Code] is equal to a control on
your form (poorly) named [Basis 1 Code]

--
Dave Hargis, Microsoft Access MVP


[QUOTE="umpire_43"]
Hi thanks for your quick reply.

Im using dlooup  under the control source to pull the information into the
text box. So i want to replace HELP ( in formula below)....will that work?  I
hope that makes sense?

=IIf(DLookUp("[Quarterly Charge -Back]","Target Data","  [Code]   ='" &
[Basis 1 Code] & "'")=0,"help",DLookUp("[Quarterly Charge -Back]","Target
Data","  [Code]   ='" & [Basis 1 Code] & "'"))

Thanks

[QUOTE="Klatuu"]
What you want to do is easy enough, but how will you get data into the text
box?

Based on your descripton, I would use the form Current event:

Me.MyTextBox.Visible = Me.MyTextBox <> 0
--
Dave Hargis, Microsoft Access MVP


:

Hi there,

Hopefully, someone can help me with this.

Is there a way of making a text box visible through a if then statement on a
form if it meets a certain condition. ( using Control Sources function on the
property box)

for example.

Make the text box visible if not equal to zero else change the visible
property to not being visible.

Or is there another way of accomplishing the same thing using the property
box conditions or something else


I hope this makes sense.

Thanks[/QUOTE][/QUOTE][/QUOTE]
 
K

Klatuu

Select the form. Use the small square button in the upper left hand corner
of the form in form design. Open the properties dialog, select events, and
look for the Current event.
--
Dave Hargis, Microsoft Access MVP


umpire_43 said:
Hi Dave,

I'm real sorry being a pest. Where am i suppose create the current event.
I don't see anything in the property dialog box that would get me started
when i right click on txtchargeback text box.

Am i missing something here?

Sorry

Keith



Klatuu said:
No, the code would not work there. Using this as the control source:
=DLookUp("[Quarterly Charge -Back]","[Target Data]","
Code:
   ='" &
Me![Basis 1 Code] & "'")

The use the code I posted earlier in the Form Current event. Note I put
brackets around Target Data.  When you put characters in a name that should
not be in a name (like a space), you need to bracket it so Access doesn't get
confused.  You code assumes:
You want to return the value in a field (poorly) named [Quarterly Charge
-Back]
The field is in a domain (table/query) (poorly) named [Target Data]
You are looking for a record where the field [Code] is equal to a control on
your form (poorly) named [Basis 1 Code]

--
Dave Hargis, Microsoft Access MVP


[QUOTE="umpire_43"]
Hi thanks for your quick reply.

Im using dlooup  under the control source to pull the information into the
text box. So i want to replace HELP ( in formula below)....will that work?  I
hope that makes sense?

=IIf(DLookUp("[Quarterly Charge -Back]","Target Data","  [Code]   ='" &
[Basis 1 Code] & "'")=0,"help",DLookUp("[Quarterly Charge -Back]","Target
Data","  [Code]   ='" & [Basis 1 Code] & "'"))

Thanks

:

What you want to do is easy enough, but how will you get data into the text
box?

Based on your descripton, I would use the form Current event:

Me.MyTextBox.Visible = Me.MyTextBox <> 0
--
Dave Hargis, Microsoft Access MVP


:

Hi there,

Hopefully, someone can help me with this.

Is there a way of making a text box visible through a if then statement on a
form if it meets a certain condition. ( using Control Sources function on the
property box)

for example.

Make the text box visible if not equal to zero else change the visible
property to not being visible.

Or is there another way of accomplishing the same thing using the property
box conditions or something else


I hope this makes sense.

Thanks[/QUOTE][/QUOTE][/QUOTE]
 
U

umpire_43

Hi Dave,

thank you so much. I wouldn't have looked there at all. Hopefully it will
work now for me.

thanks again
keith

Klatuu said:
Select the form. Use the small square button in the upper left hand corner
of the form in form design. Open the properties dialog, select events, and
look for the Current event.
--
Dave Hargis, Microsoft Access MVP


umpire_43 said:
Hi Dave,

I'm real sorry being a pest. Where am i suppose create the current event.
I don't see anything in the property dialog box that would get me started
when i right click on txtchargeback text box.

Am i missing something here?

Sorry

Keith



Klatuu said:
No, the code would not work there. Using this as the control source:
=DLookUp("[Quarterly Charge -Back]","[Target Data]","
Code:
   ='" &
Me![Basis 1 Code] & "'")

The use the code I posted earlier in the Form Current event. Note I put
brackets around Target Data.  When you put characters in a name that should
not be in a name (like a space), you need to bracket it so Access doesn't get
confused.  You code assumes:
You want to return the value in a field (poorly) named [Quarterly Charge
-Back]
The field is in a domain (table/query) (poorly) named [Target Data]
You are looking for a record where the field [Code] is equal to a control on
your form (poorly) named [Basis 1 Code]

--
Dave Hargis, Microsoft Access MVP


:

Hi thanks for your quick reply.

Im using dlooup  under the control source to pull the information into the
text box. So i want to replace HELP ( in formula below)....will that work?  I
hope that makes sense?

=IIf(DLookUp("[Quarterly Charge -Back]","Target Data","  [Code]   ='" &
[Basis 1 Code] & "'")=0,"help",DLookUp("[Quarterly Charge -Back]","Target
Data","  [Code]   ='" & [Basis 1 Code] & "'"))

Thanks

:

What you want to do is easy enough, but how will you get data into the text
box?

Based on your descripton, I would use the form Current event:

Me.MyTextBox.Visible = Me.MyTextBox <> 0
--
Dave Hargis, Microsoft Access MVP


:

Hi there,

Hopefully, someone can help me with this.

Is there a way of making a text box visible through a if then statement on a
form if it meets a certain condition. ( using Control Sources function on the
property box)

for example.

Make the text box visible if not equal to zero else change the visible
property to not being visible.

Or is there another way of accomplishing the same thing using the property
box conditions or something else


I hope this makes sense.

Thanks[/QUOTE][/QUOTE][/QUOTE]
 
K

Klatuu

I hope so, too. Post back if you have any questions.
--
Dave Hargis, Microsoft Access MVP


umpire_43 said:
Hi Dave,

thank you so much. I wouldn't have looked there at all. Hopefully it will
work now for me.

thanks again
keith

Klatuu said:
Select the form. Use the small square button in the upper left hand corner
of the form in form design. Open the properties dialog, select events, and
look for the Current event.
--
Dave Hargis, Microsoft Access MVP


umpire_43 said:
Hi Dave,

I'm real sorry being a pest. Where am i suppose create the current event.
I don't see anything in the property dialog box that would get me started
when i right click on txtchargeback text box.

Am i missing something here?

Sorry

Keith



:

No, the code would not work there. Using this as the control source:
=DLookUp("[Quarterly Charge -Back]","[Target Data]","
Code:
   ='" &
Me![Basis 1 Code] & "'")

The use the code I posted earlier in the Form Current event. Note I put
brackets around Target Data.  When you put characters in a name that should
not be in a name (like a space), you need to bracket it so Access doesn't get
confused.  You code assumes:
You want to return the value in a field (poorly) named [Quarterly Charge
-Back]
The field is in a domain (table/query) (poorly) named [Target Data]
You are looking for a record where the field [Code] is equal to a control on
your form (poorly) named [Basis 1 Code]

--
Dave Hargis, Microsoft Access MVP


:

Hi thanks for your quick reply.

Im using dlooup  under the control source to pull the information into the
text box. So i want to replace HELP ( in formula below)....will that work?  I
hope that makes sense?

=IIf(DLookUp("[Quarterly Charge -Back]","Target Data","  [Code]   ='" &
[Basis 1 Code] & "'")=0,"help",DLookUp("[Quarterly Charge -Back]","Target
Data","  [Code]   ='" & [Basis 1 Code] & "'"))

Thanks

:

What you want to do is easy enough, but how will you get data into the text
box?

Based on your descripton, I would use the form Current event:

Me.MyTextBox.Visible = Me.MyTextBox <> 0
--
Dave Hargis, Microsoft Access MVP


:

Hi there,

Hopefully, someone can help me with this.

Is there a way of making a text box visible through a if then statement on a
form if it meets a certain condition. ( using Control Sources function on the
property box)

for example.

Make the text box visible if not equal to zero else change the visible
property to not being visible.

Or is there another way of accomplishing the same thing using the property
box conditions or something else


I hope this makes sense.

Thanks[/QUOTE][/QUOTE][/QUOTE]
 

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