Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Force user to make a combobox selection

Posted on 2014-10-05
1
182 Views
Last Modified: 2014-10-05
I want to force the user to make a combobox selection before the rest of the code can execute but this isn't working correctly.  The msgbox tells them they have to make a selection but then goes on with the rest of the code anyway.

    If IsNull(Me.cboMemberID) Then
        MsgBox "You must select a member before proceeding."
        Me.cboMemberID.SetFocus
    End If

then the rest of the code ...

Open in new window

0
Comment
Question by:SteveL13
1 Comment
 
LVL 33

Accepted Solution

by:
Norie earned 500 total points
ID: 40362487
I'm not sure where you have placed the code but if you want to stop the code after the If statement being executed try adding Exit Sub before the End If.
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question