D
Douglas J. Steele
Works fine for me. In what event have you put that code?
-----Original Message-----
Hi Tom,
Your code would only work if you are actually storing the literal string
"--" into the State field when not needed. Instead, I would toggle the
visible property of the control based on the value in the Country control -
add the following to the AfterUpdate and Current events of the form. FWIW, I
would probably do this with the enabled property instead of visible but it's
your call
me.State.visible=me.Country <> "USA"
--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.
Does anyone know what's wrong w/ the IF statement below?
If Me.State.Value = "--" Then
Me.State.Visible = False
Else
Me.State.Visible = True
End If
I don't want to show the "state" textfield if the country
is e.g. Spain or France (for which I don't use state
values such as AZ, CA, TX, VA, etc.).
Currrently, I either show or don't show the state value
text box on the form (regardless of wha the value in the
state field is).
Again, I'd appreciate any pointers that will hide/unhide
the textbox depending on the value.
Thanks,
Tom
.
Sandra:
Thanks for your quick turn-around...
Hmh, that's an idea... I tried it State.Visible to
Country dependeny in the On Open form.
You suggested the AfterUpdate... the form that pulls the
information is purely for Read-Only and data will not be
updated in that particular form.
Currently, I have the following in the On Open Event of
the form... it still does not work though.
Tom
Private Sub Form_Open(Cancel As Integer)
Me.State.visible=me.Country <> "USA"
End Sub
-----Original Message-----
Hi Tom,
Your code would only work if you are actually storing the literal string
"--" into the State field when not needed. Instead, I would toggle the
visible property of the control based on the value in the Country control -
add the following to the AfterUpdate and Current events of the form.
FWIW, I would probably do this with the enabled property instead of
visible but it's your call
me.State.visible=me.Country <> "USA"
--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.
Does anyone know what's wrong w/ the IF statement below?
If Me.State.Value = "--" Then
Me.State.Visible = False
Else
Me.State.Visible = True
End If
I don't want to show the "state" textfield if the country
is e.g. Spain or France (for which I don't use state
values such as AZ, CA, TX, VA, etc.).
Currrently, I either show or don't show the state value
text box on the form (regardless of wha the value in the
state field is).
Again, I'd appreciate any pointers that will hide/unhide
the textbox depending on the value.
Thanks,
Tom
.
-----Original Message-----
If it is read-only then you should probably use the Current event. This
event fires when the focus moves to a record. I think the Open event is too
soon. Even the Load event would only catch the first record. Try it with the
Current event and let me know if you still have problems.
--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.
Sandra:
Thanks for your quick turn-around...
Hmh, that's an idea... I tried it State.Visible to
Country dependeny in the On Open form.
You suggested the AfterUpdate... the form that pulls the
information is purely for Read-Only and data will not be
updated in that particular form.
Currently, I have the following in the On Open Event of
the form... it still does not work though.
Tom
Private Sub Form_Open(Cancel As Integer)
Me.State.visible=me.Country <> "USA"
End Sub
-----Original Message-----
Hi Tom,
Your code would only work if you are actually storing the literal string
"--" into the State field when not needed. Instead, I would toggle the
visible property of the control based on the value in the Country control -
add the following to the AfterUpdate and Current events of the form.
FWIW, I would probably do this with the enabled property instead of
visible but it's your call
me.State.visible=me.Country <> "USA"
--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.
Tom wrote:
Does anyone know what's wrong w/ the IF statement below?
If Me.State.Value = "--" Then
Me.State.Visible = False
Else
Me.State.Visible = True
End If
I don't want to show the "state" textfield if the country
is e.g. Spain or France (for which I don't use state
values such as AZ, CA, TX, VA, etc.).
Currrently, I either show or don't show the state value
text box on the form (regardless of wha the value in the
state field is).
Again, I'd appreciate any pointers that will hide/unhide
the textbox depending on the value.
Thanks,
Tom
.
.
Sanda:
EXCELLENT!!! This works great!
I now understand the difference between "On Open"
and "Current".
Thanks so much for sharing the information.
Tom
-----Original Message-----
If it is read-only then you should probably use the Current event. This
event fires when the focus moves to a record. I think the Open event is too
soon. Even the Load event would only catch the first record. Try it with
the Current event and let me know if you still have problems.
--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.
Sandra:
Thanks for your quick turn-around...
Hmh, that's an idea... I tried it State.Visible to
Country dependeny in the On Open form.
You suggested the AfterUpdate... the form that pulls the
information is purely for Read-Only and data will not be
updated in that particular form.
Currently, I have the following in the On Open Event of
the form... it still does not work though.
Tom
Private Sub Form_Open(Cancel As Integer)
Me.State.visible=me.Country <> "USA"
End Sub
-----Original Message-----
Hi Tom,
Your code would only work if you are actually storing the literal
string "--" into the State field when not needed. Instead, I would
toggle the visible property of the control based on the value in the
Country control - add the following to the AfterUpdate and Current
events of the form. FWIW, I would probably do this with the enabled
property instead of visible but it's your call
me.State.visible=me.Country <> "USA"
--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.
Tom wrote:
Does anyone know what's wrong w/ the IF statement below?
If Me.State.Value = "--" Then
Me.State.Visible = False
Else
Me.State.Visible = True
End If
I don't want to show the "state" textfield if the country
is e.g. Spain or France (for which I don't use state
values such as AZ, CA, TX, VA, etc.).
Currrently, I either show or don't show the state value
text box on the form (regardless of wha the value in the
state field is).
Again, I'd appreciate any pointers that will hide/unhide
the textbox depending on the value.
Thanks,
Tom
.
.