By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,455 Members | 2,256 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,455 IT Pros & Developers. It's quick & easy.

hide check box in form

P: 59
How can I write code who will hide check box in a form after confirmed.
Feb 11 '08 #1
Share this Question
Share on Google+
1 Reply


MMcCarthy
Expert Mod 10K+
P: 14,534
You need to create an after update event on the checkbox control.

If your checkbox name was check1 then ...
Expand|Select|Wrap|Line Numbers
  1. Private Sub check1_AfterUpdate()
  2.  
  3.     If Me!check1 = -1 Then
  4.         ' move focus to the next control on the form
  5.         Me!ctlName.SetFocus
  6.         Me!check1.Visible = False
  7.     Else
  8.         Me!ctlName.SetFocus
  9.         Me!check1.Visible = True
  10.     End If
  11.  
  12. End Sub
  13.  
  14. ' The following code would also need to be placed in the On Current event of the form.
  15. Private Sub Form_OnCurrent()
  16.  
  17.     If Me!check1 = -1 Then
  18.         ' move focus to the next control on the form
  19.         Me!check1.Visible = False
  20.     Else
  21.         Me!check1.Visible = True
  22.     End If
  23.  
  24. End Sub
  25.  
Feb 11 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.