I have always done this type of thing on the Form_Current event.  That
way when the user switches from record to record the form updates. 

Dawn Crosier
Application Specialist
"Education Lasts a Lifetime"
 
This message was posted to a newsgroup.  Please post replies and
questions to the group so that others can learn as well.
 
 

-----Original Message-----
From: AccessDevelopers@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Irshad Jamal
Sent: Thursday, October 20, 2005 4:46 AM
To: AccessDevelopers@yahoogroups.com
Subject: [AccessDevelopers] Hiding and showing controls

Dear Users,

I have an Operator form containing 2 check boxes and 3 textboxes with
associated labels.

1) chkPersonnellTrained, if it is checked I want the Date trained label
and textbox to show, if the checkbox is unchecked then the label and
textbox should remain hidden.
2) chkFormalContract, it is checked I want the intial and final date of
contract labels and textboxes to show, the same for this box.

I want this to be valid for each record in the table, as you navigate
from record to record on the form.

I have put the following code in the load event of the operator form:

If chkPersonnellTrained.Value = 1 Then
lblDateLastTrained.Visible = True
txtDateLastTrained.Enabled = True
ElseIf chkPersonnellTrained.Value = 0 Then lblDateLastTrained.Visible =
False txtDateLastTrained.Enabled = False End If If chkIsContract.Value =
1 Then lblInitialContractDate.Visible = True
txtInitialContractDate.Visible = True lblFinalContractDate.Visible =
True txtFinalContractDate.Visible = True ElseIf chkIsContract.Value = 0
Then lblInitialContractDate.Visible = False
txtInitialContractDate.Visible = False lblFinalContractDate.Visible =
False txtFinalContractDate.Visible = False End If End Sub

The labels and textboxes only appear and dissapear when I check the box
for each record in the form manually, it does not happen automatically
on startup when a new record is being entered.

Any help on this will be much appreciated.

Thank you.

Irshad 


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/q7folB/TM
--------------------------------------------------------------------~-> 


Please zip all files prior to uploading to Files section. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AccessDevelopers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




Reply via email to