Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2004
    Location
    Raleigh, NC
    Posts
    146

    Post Unanswered: Executing code with record switch

    I have 4 controls that I would like to make invisible if the value of a text box is "Personal"... else all 4 are visible. My question is this... Which event is the best to place the following code in so that when I switch records, the code is executed each time?

    Code:
    If Me.txtAccountType.Value = "Personal" Then
    Me.cmdAddContact.Visible = False
    Me.lblContactNo.Visible = False
    Me.txtContactNo.Visible = False
    Me.cmdEditContact.Visible = False
    Else
    Me.cmdAddContact.Visible = True
    Me.lblContactNo.Visible = True
    Me.txtContactNo.Visible = True
    Me.cmdEditContact.Visible = True
    End If

  2. #2
    Join Date
    Nov 2004
    Posts
    23
    On Current

  3. #3
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    ... And sometimes to be contrarian I do code like this:

    Me.cmdAddContact.Visible = IIf(Me.txtAccountType.Value & "" = "Personal" ,False,True)

    ...
    Back to Access ... ADO is not the way to go for speed ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •