Hiding a field in Access 2000 using "Code Builder"

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi I hope someone can help

Im am trying to hide a field on a Access Form, but assign a command button
to make the field visible so that when i click on the command button I am
asked for a password .

This is the what I am trying to use but its not working

Private Sub Command135_Click()
Sub hide()
Dim Password As String
Dim ans As String
Password = "******"
ans = InputBox("Enter Password")
If ans = Password Then
Documents.Visible = True
Else
Documents.Visible = False
End If

End Sub


can someone tell me where i am going wrong

.



Relevant Pages

  • Re: Global Variables
    ... Chip Pearson ... > Public name As String ... > Public Sub FindUser() ... > Command with Team, Team Leader and Command. ...
    (microsoft.public.excel.programming)
  • Password
    ... It bombs in the COMMAND BUTTON code at: ... Private Sub cmdLetMeIn_Click ... Sub cpw(empid As Long, pw As String) ... Dim cmd1 As Command ...
    (microsoft.public.access.formscoding)
  • Re: Global Variables
    ... Public name As String ... Public Sub FindUser() ... Command with Team, Team Leader and Command. ... >> 'blah blah blah ...
    (microsoft.public.excel.programming)
  • Re: command button - pass a parameter to open a form based on a qu
    ... "Rick B" wrote: ... >> I have a main form with about 15 command buttons the code for the command ... >> Private Sub Command18_Click ... >> Dim stLinkCriteria As String ...
    (microsoft.public.access.formscoding)
  • Re: Need Help in VBA Code
    ... Public Sub AssignNumber() ... Dim strSysNumber As String ... Dim varResult As Variant ... then call this Sub from a command button or an After Update ...
    (microsoft.public.access.formscoding)