Consulting

Results 1 to 3 of 3

Thread: Is it possible to create a message box from a drop down menu using vba or a macro?

  1. #1
    VBAX Mentor
    Joined
    Aug 2010
    Posts
    457
    Location

    Is it possible to create a message box from a drop down menu using vba or a macro?

    Hi, I'm currently using access 2007. I've developed a form with a drop down list of different venues and a checkbox on my table of each venue that is available for a New Year's eve event. Is it possible to display a messagebox based on the drop down selection and checkbox being ticked or unticked displaying a message - "Venue will be available" or "Venue will not be available" on my form? Also, is it possible to hide the checkbox selection on the form? Is this possible using vba? If so, do you have any examples of code how this can be done? I've read a few vba books and searched websites but haven't seen as yet any ideas how to do this...I am a novice/intermediate user of vba...


    Thanks for your contributions

  2. #2
    VBAX Expert Imdabaum's Avatar
    Joined
    Jun 2006
    Posts
    652
    Location
    Wedd, you most likely won't find specific examples of what you are trying to do for step by step instructions. Try to break it down into smaller phases. Step1: You want a message box with text that is based on the drop down selection.
    [vba]
    Sub Alert()
    Dim msg as String
    Select Case Me.[Yourdropdowncontrol's name]
    Case A
    msg = "item1"
    Case B
    msg = "item2"
    Case C
    msg = "item3"
    Case D
    msg = "item4"
    'Case......
    End Select
    MsgBox(msg[,title][,iconType])
    End Sub
    [/vba]

    I need clarificaiton on the checkboxes. Are they being taken into account within the message box? Or is this a different message box that would be displayed when the checkbox is ticked/or unticked?
    Someday I'll understand everything...
    Even then...I'll still pretend I'm a beginner.

  3. #3
    VBAX Mentor
    Joined
    Aug 2010
    Posts
    457
    Location
    Yes, Imdabaum, its a different messagebox. Basically when a checkbox is being ticked it should display a message "venue is available" , and when the checkbox is not ticked it will display a message "venue is not available". I hope that is clear...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •