Results 1 to 2 of 2
  1. #1
    adi.shoukat is offline Novice
    Windows 7 Access 2007
    Join Date
    Feb 2010
    Posts
    1

    Checkbox in forms

    Hi,
    I am worried how would I make decisions in MS access depending on weather my checkbox is checked or not ...

    What I want is:
    I have three check boxes: box1, box2, box3 (Say)

    If box1 is checked I want the criteria for a particular field to be:
    "Box1_"


    If box1 and box2 are selected it should be: "Box1_" || "Box2_"
    And if box1, box2 and box3 are selected it should be: "Box1_" || "Box2_" || "Box3_"

    Can anyone please help me with this ???

  2. #2
    SoftwareMatters is offline Access VBA Developers
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    274
    On the afterupdate of each checkbox and the oncurrent of the form you will need some code to run. I would write a Sub and call it where I mentioned earlier. The function will be something like this:

    Private Sub UpdatetextField()
    Dim TextStr as String
    TextStr = ""
    If Me!Box1 = True Then TextStr = "Box1_"
    If Me!Box2 = True Then
    If TextStr <> "" then TextStr = TextStr & " || "
    TextStr = TextStr & "Box2_"
    End If
    If Me!Box3 = True Then
    If TextStr <> "" then TextStr = TextStr & " || "
    TextStr = TextStr & "Box3_"
    End If
    Me!TextBox = TextStr
    End Sub

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

Similar Threads

  1. Using a checkbox help
    By gbjc105 in forum Forms
    Replies: 1
    Last Post: 01-28-2010, 08:27 PM
  2. Checkbox not working
    By terryvanduzee in forum Programming
    Replies: 4
    Last Post: 10-23-2009, 10:36 AM
  3. Toggle checkbox
    By stewarta in forum Programming
    Replies: 9
    Last Post: 04-16-2009, 02:45 PM
  4. Checkbox
    By Rbtsmith in forum Access
    Replies: 2
    Last Post: 02-17-2009, 04:19 PM
  5. checkbox
    By Suresh in forum Forms
    Replies: 0
    Last Post: 12-19-2007, 01: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