dbTalk Databases Forums  

After >* (new record) invisible fields become visible

comp.databases.ms-access comp.databases.ms-access


Discuss After >* (new record) invisible fields become visible in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
rweijers
 
Posts: n/a

Default After >* (new record) invisible fields become visible - 07-29-2003 , 10:18 AM






Hello,

I have some fields which become visible after I've checked a box:

Private Sub Trigger()
If (Me.Trigger = True Or Me.Trigger = Not Null) Then
Me.Problem.Visible = True
Else
Me.Problem.Visible = False
End If
End Sub

The trigger-checkbox has "Default Value = False"
The Problem-field has property "Visible = NO"

I create a new record.
The problem field is not visible. OK.
I check the Trigger and the problem field becomes visible. OK.
I click on >* (the new-record button) and the problem field is still
visible?!?

What can I do to make sure that the invisible fields are ALWAYS
invisible in a new record?

Thanx!

Reply With Quote
  #2  
Old   
Allen Browne
 
Posts: n/a

Default Re: After >* (new record) invisible fields become visible - 07-29-2003 , 11:42 AM






The test:
Me.Triger = Not Null
will never be true. Try:
Not IsNull(Me.Trigger)

For an explanation see:
Common errors with Null
at:
http://allenbrowne.com/casu-12.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to the newsgroup. (Email address has spurious "_SpamTrap")

"rweijers" <rob_weijers (AT) hotmail (DOT) com> wrote

Quote:
I have some fields which become visible after I've checked a box:

Private Sub Trigger()
If (Me.Trigger = True Or Me.Trigger = Not Null) Then
Me.Problem.Visible = True
Else
Me.Problem.Visible = False
End If
End Sub

The trigger-checkbox has "Default Value = False"
The Problem-field has property "Visible = NO"

I create a new record.
The problem field is not visible. OK.
I check the Trigger and the problem field becomes visible. OK.
I click on >* (the new-record button) and the problem field is still
visible?!?

What can I do to make sure that the invisible fields are ALWAYS
invisible in a new record?

Thanx!



Reply With Quote
  #3  
Old   
Bob Quintal
 
Posts: n/a

Default Re: After >* (new record) invisible fields become visible - 07-29-2003 , 12:24 PM



rob_weijers (AT) hotmail (DOT) com (rweijers) wrote in
news:7a30f274.0307290718.17f2b5fa (AT) posting (DOT) google.com:

Quote:
Hello,

I have some fields which become visible after I've checked a box:

Private Sub Trigger()
If (Me.Trigger = True Or Me.Trigger = Not Null) Then
Me.Problem.Visible = True
Else
Me.Problem.Visible = False
End If
End Sub

The trigger-checkbox has "Default Value = False"
The Problem-field has property "Visible = NO"

I create a new record.
The problem field is not visible. OK.
I check the Trigger and the problem field becomes visible. OK.
I click on >* (the new-record button) and the problem field is still
visible?!?

What can I do to make sure that the invisible fields are ALWAYS
invisible in a new record?
I assume trigger is unbound to any field in the form.
First analyse your condition.
Quote:
If (Me.Trigger = True Or Me.Trigger = Not Null) Then
given trigger can be true, false or null, you can simplify this to
If not isnull(me.trigger) then
I doubt that this is really what you want to test. Since it is unbound,
trigger will stay not null until the form is closed.

Change the test to If me.trigger = true
In the OnCurrent event, set problem.visible = no
This will solve your problem.

Bob





Quote:
Thanx!


Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.