Results 1 to 2 of 2
  1. #1
    MaxLev is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2012
    Posts
    2

    Creating If Statement in form

    Hello,



    I am creating a form that has roughly 20 cells that have the option to be filled in. There are 3 groups of cells. The first group will always have data, but the second and third may not. The user has a drop down box that will say 'Second group has data' or 'Second group does not have data.'

    I would like to create an IF statement that says, if the dropdown box says 'YES DATA' allow user to fill in the appropriate data, and if 'NO DATA', make those cells equal the value of the first group of data.


    How would one create this type of IF statement?

    It seems really easy in Excel, but I can't figure it out here.

    Max

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Need VBA code. Use the combobox AfterUpdate event:

    If Me.comboboxname = "Second group does not have data" Then
    Me.controlname2 = Me.controlname1
    Me.controlname2.Locked = True
    Else
    Me.controlname2.Locked = False
    End If
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Possible If statement for loading of a form
    By computer_man20037 in forum Programming
    Replies: 2
    Last Post: 05-16-2012, 09:53 AM
  2. IF(AND Statement in a Form
    By bkirsch in forum Access
    Replies: 1
    Last Post: 02-03-2012, 09:57 AM
  3. Main Form If Statement
    By qbc in forum Forms
    Replies: 1
    Last Post: 01-21-2012, 05:27 PM
  4. If Statement in form
    By ismith in forum Forms
    Replies: 3
    Last Post: 12-07-2011, 12:18 PM
  5. Replies: 7
    Last Post: 08-17-2011, 01:49 PM

Tags for this Thread

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