Results 1 to 3 of 3
  1. #1
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    776

    If Statement assistance with form current

    Hi all,
    On my form i have two option groups and i would like to get some help in getting the first line correct in code. If OptGender = 2 and If Opt = 3,4, or 5 then,



    I just am unsure how to write that first line?

    Code:
    Form_Current
    
    	If OptGender = 2 AND If OptStatus = 3,4,5 Then
    	Me.TxtMaidenName.Enabled = True
    	Me.ChkUseMaiden.Enabled = True
    	Me.ChkUseMaidenLast. Enable = True
    	Else
    	Me.TxtMaidenName.Enabled = False
    	Me.ChkUseMaiden.Enabled = False
    	Me.ChkUseMaidenLast. Enable = False
    End If

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,543
    Try:
    Code:
        
    If OptGender = 2 AND (OptStatus = 3 OR OptStatus = 4 OR OptStatus = 5) Then
          Me.TxtMaidenName.Enabled = True
          Me.ChkUseMaiden.Enabled = True
          Me.ChkUseMaidenLast. Enable = True
    Else
          Me.TxtMaidenName.Enabled = False
          Me.ChkUseMaiden.Enabled = False
          Me.ChkUseMaidenLast. Enable = False 
    End If
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    776
    Thank you so much!\
    Dave

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

Similar Threads

  1. user if statement to get current year value
    By tagteam in forum Access
    Replies: 4
    Last Post: 12-02-2019, 05:17 PM
  2. Replies: 2
    Last Post: 05-04-2019, 08:28 AM
  3. Using current computer date in iif statement
    By Kusaf8 in forum Programming
    Replies: 8
    Last Post: 04-12-2016, 07:49 PM
  4. Adding a Count function to current select statement
    By johnson8809 in forum Queries
    Replies: 2
    Last Post: 02-21-2015, 07:32 PM
  5. Assistance in form/query
    By abodi in forum Forms
    Replies: 1
    Last Post: 09-19-2011, 03:30 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