Results 1 to 7 of 7
  1. #1
    MarkV is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Dec 2014
    Posts
    27

    Form with Combo Box and Button to Open


    I have a Combo Box that has a drop down of Project Numbers. The user must drop down and go to a project number. However if they hit the button without putting a value in the combo box, and hits the open button, it gives me all these screens that pop up. How can I put a MSGBOX or something, that wont allow them to just hit the button without entering a value in the combo box. And the mistake screens don't come up. Thank you. Hope you understand...LOL...
    Best Regards...Mark

  2. #2
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    something like

    Code:
    if isnull(combobox) then
        msgbox "must select a project number"
    Else
        ....
        your code here
    end if

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    I would just add to Ajax's post, that this could be done in the Click event of the button.

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Am I missing something, here? This kind of thing is usually done with the code to go to a given project in the AfterUpdate event of the Combobox...if nothing is selected, nothing happens...including error messages!

    Linq ;0)>

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Linq,

    Agreed, but if OP needs the combo to be valued and wants to prevent a number of forms to be opened based on the button click. Checking the button click seems reasonable, especially since user is able to Click the button without making a combo selection.

  6. #6
    MarkV is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Dec 2014
    Posts
    27
    Thank YOU so much!!!!!!!!!!!!!!!! Gonna Try

    Best Mark

  7. #7
    MarkV is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Dec 2014
    Posts
    27
    Thank you so much

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

Similar Threads

  1. Open Up a Sub-Form With a Button
    By philip.mccollum in forum Forms
    Replies: 2
    Last Post: 04-08-2015, 05:24 PM
  2. Replies: 6
    Last Post: 02-15-2015, 11:51 AM
  3. Replies: 22
    Last Post: 05-10-2014, 04:43 PM
  4. Replies: 1
    Last Post: 05-31-2013, 08:53 AM
  5. cmd button to open form
    By stephaniehpcswf in forum Access
    Replies: 1
    Last Post: 02-23-2011, 04:46 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