Results 1 to 9 of 9
  1. #1
    justauser is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    15

    Checkbox


    I have a checkbox on my form that when "Checked" I would like to have a message pop up to tell the end user to use another form. I would like this message to populate any time a record is accessed with that box checked. Can anybody point me in the right direction?

  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,641
    The current event fires when the form loads and when the user changes records. You could put code there to test that field and fire a message box.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    justauser is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    15
    Thanks for the direction. I having a hard time writing the code. This is the code that I have written.

    Private Sub Form_Current()
    If Forms!Table1!CheckBox1.CheckState = Yes Then

    MsgBox ("Checked")

    End If

    End Sub

    I am a newbie at this coding thing. I've just been reading up and doing online tutorials for the VBA coding. Any help would be great. Thanks.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Try

    If Forms!Table1.CheckBox1 = True Then
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    justauser is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    15
    I guess I should add that when I run this code I get this error.

    Run-time error '438':
    Object doesn't support this property or method

  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,641
    Did you try the code in post 4?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    justauser is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    15
    I did try the code. It is populating the message box, but only when the form itself loads. Is there a way to link that message box back to the checkbox on the form?

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    If you want it to fire when the user checks the box, you'd need the same code in the after update event of the checkbox.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    justauser is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    15
    I don't know if it matters, but I have a combo box that is searching for and pulling in the records.

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

Similar Threads

  1. Checkbox
    By huongdl1987 in forum Forms
    Replies: 1
    Last Post: 06-23-2011, 05:29 PM
  2. Checkbox help
    By NateHaze in forum Programming
    Replies: 3
    Last Post: 05-26-2011, 02:50 PM
  3. QBF - Checkbox
    By radink in forum Queries
    Replies: 17
    Last Post: 04-19-2011, 03:47 PM
  4. Checkbox
    By Patience in forum Access
    Replies: 5
    Last Post: 06-22-2010, 05:37 AM
  5. Using a checkbox help
    By gbjc105 in forum Forms
    Replies: 1
    Last Post: 01-28-2010, 08:27 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