Results 1 to 3 of 3
  1. #1
    ChuckJ is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2013
    Posts
    4

    Changing visiblity of field based on another. Code not working

    I have a Form with Tabs inside it. On one page I would like one field to not be visible if another field has "Yes" in it. However, I can not get the code to work. I inserted this code into VB and then changed from Design view to Form view and it doesnt appear to work. I looked around on the net and many say to use OnCurrent, but I dont even have that option so I went with BeforeUpdate




    Code:
    Private Sub R9790_SN_BeforeUpdate(Cancel As Integer)
    If Me.Fld9790 = "Yes" Then
    Me.R9790_SN.Visible = True
    Me.SD.Visible = False
    Else
    Me.R9790_SN.Visible = False
    Me.SD.Visible = True
    End If
    
    
    End Sub

  2. #2
    ChuckJ is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2013
    Posts
    4
    Disregard. I forget OnCurrent is available in Form properties. Code is working now

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    It would only need to be:

    R9790_SN.Visible = Fld9790 = "Yes"
    SD.Visible = Fld9790 = "No"

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Changing Date Formats in SQL Query Not Working
    By Markb384 in forum Queries
    Replies: 9
    Last Post: 05-02-2014, 08:55 AM
  2. Replies: 6
    Last Post: 02-12-2014, 05:16 PM
  3. Replies: 9
    Last Post: 08-19-2013, 01:08 PM
  4. Replies: 2
    Last Post: 01-31-2013, 07:44 PM
  5. Changing tables based on field date
    By dssrun in forum Programming
    Replies: 6
    Last Post: 07-10-2011, 10:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums