Results 1 to 6 of 6
  1. #1
    Kevo is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Location
    Kodiak, Alaska
    Posts
    86

    Question about forms...

    Yet another question. Sorry!

    Ok, here is what I would like to do. Please let me know if there is an easier way or what I should research/learn.

    Can you create a form that asks for certain info....but if, let's say, a toggle switch is selected, then the form would ask for additional info?


    In other words, can you have fields in your table that only are visible on your form if a selection is made?

    Thank You,
    Kevin

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Wouldn't be much of a forum if nobody was asking questions!

    Is this what you're looking for?

    http://www.baldyweb.com/ConditionalVisibility.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Kevo is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Location
    Kodiak, Alaska
    Posts
    86
    Thanks a bunch Paul!

    I am so glad that access is finally starting to make a little sense.
    I know just enough to be dangerous!

    So, I followed your suggestion and put this

    Private Sub Check40_AfterUpdate()
    If Me.Check40 = True Then
    Me.Combo25.Visible = True
    Else
    Me.Combo25.Visible = False
    End If
    End Sub

    in the After Update of a toggle control. It works great.

    Now if I may ask you for a little more.... I am just beginning to learn VBA so I am sure this is an easy answer, but I would like to make 3 controls visible or not depending on the toggle.

    What is the proper language for combining more than one?

    Is it:

    Private Sub Check1_AfterUpdate()
    If Me.Check1 = True Then
    Me.Combo1.Visible = True & Me.Combo2.Visible = True & Me.Combo3.Visible = True
    Else
    Me.Combo1.Visible = False & Me.Combo2.Visible = False & Me.Combo3.Visible = False

    End If
    End Sub

    Thanks again for the help....You folks in this forum are making me look really smart at work.

  4. #4
    Kevo is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Location
    Kodiak, Alaska
    Posts
    86
    Never mind Paul..... Duh, I figured it out.

    But someone can still let me know if this is proper code.

    Private Sub Check1_AfterUpdate()
    If Me.Check1 = True Then
    Me.Combo2.Visible = True
    Me.Combo3.Visible = True

    Else
    Me.Combo2.Visible = False
    Me.Combo3.Visible = False
    End If


    Thanks

  5. #5
    Kevo is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Location
    Kodiak, Alaska
    Posts
    86
    Ok, spoke too soon.

    This works great except when I go to my next record it remembers the toggle from the last record and does not "record" the first?

    Hope that makes sense.....

    I want the toggle to record a "yes" in the corresponding field in the record as well as showing or not showing the other 3 fields.


    In other words,


    Is this an "Immediate Utilization Sterilization Load"? (if yes then)


    the following 3 fields are visible


    Cycle Temp:

    Cycle Time:

    Reason For IUS Load:


    And I will end up with the 4 fields (IUSLoad, CycleTemp,CycleTime,IUSReason) recorded in my table along with the other fields that come before this on the form.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    From the link: "You might also want the code in the Current event, which would fire when you change records".
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Multiple users & forms question.
    By Bejo25 in forum Database Design
    Replies: 2
    Last Post: 02-03-2011, 08:26 PM
  2. tabbed forms .. QUICK question!
    By kroenc17 in forum Forms
    Replies: 2
    Last Post: 12-01-2010, 08:38 AM
  3. Simple forms/queries question (I hope!)
    By Remster in forum Access
    Replies: 6
    Last Post: 09-07-2010, 12:08 PM
  4. Novice question about using established forms
    By runabout6 in forum Access
    Replies: 2
    Last Post: 08-23-2010, 09:00 PM
  5. Replies: 4
    Last Post: 04-01-2009, 08:49 PM

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