Aha! You are testing for whether the checkbox is null... but wouldn't it
always be either Yes or No?!
Test for that instead, with something like:
If Me!chkBoardMember = True Then
Else
End if
Here are a few other ideas...
Try replacing "Me.xxxx" with "Me!xxxx" in those procedures.
Open a code module window (VBA).
Highlight a line of code (your first "If IsNull(...)"). In the menu, I
believe under Debug, click on the command that sets a Breakpoint.
Now, close/save the module window and run the form. When the code fires, it
should jump to the code window, stopped at the breakpoint.
Try searching on-line for "breakpoint" and "stepping through code" for more
ideas.
Regards
Jeff Boyce
Microsoft Access MVP
--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.
Any code or psuedocode included in this post is offered "as is", with no
guarantee as to suitability.
You can thank the FTC of the USA for making this disclaimer
possible/necessary.
scottyboyb said:
Just had (brilliant?) thought? Checked and field Positionisnamed same in
form
like BoardMember. I changed it to txtPosition. No Joy. HEre is new, new
code:
Private Sub Form_Current()
If IsNull(Me.chkBoardMember) Then
Me.txtPosition.Visible = False
Else
Me.txtPosition.Visible = True
End If
End Sub
Private Sub chkBoardMember_AfterUpdate()
If IsNull(Me.chkBoardMember) Then
Me.txtPosition.Visible = False
Else
Me.txtPosition.Visible = True
End If
End Sub
Thanks,
Scott
Jeff Boyce said:
By "not working" do you mean it always stays visible? ... or invisible?
If this were mine, I'd add in a breakpoint to that code so I could
inspect
the value of the control as the code runs. ... and I'm guessing that the
control is named [BoardMember], EXACTLY the same as the underlying field.
This might cause problems .. what happens if you name the control
something
else (e.g., chkBoardMember) and modify your code to reflect that?
Are you quite certain that the underlying field is a yes/no data type
field,
and is only "yes" or "no" (true/false)?
Regards
Jeff Boyce
Microsoft Access MVP
--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.
Any code or psuedocode included in this post is offered "as is", with no
guarantee as to suitability.
You can thank the FTC of the USA for making this disclaimer
possible/necessary.
Hello, anyone want to tell a very newbie code boy why this is not
working?
Private Sub BoardMember_AfterUpdate()
If IsNull(Me.BoardMember) Then
Me.Position.Visible = False
Else
Me.Position.Visible = True
End If
End Sub
where BoardMember is a Y/N (checkbox) field on the form from table
Contributors and Position is a text field on the same form from the
same
table. The form is a data entry form. The Data Entry field in the
form's
data
tab is set to Yes. Popup and Modal are also set to Yes on the Other
Tab.
I currently have this event set in the after update line of the events
tab.
Where should it go?
Thanks,
Scott
.
.