ListBox value when nothing selected

  • Thread starter Thread starter jpalmerx
  • Start date Start date
J

jpalmerx

Hi,

I have a form in Access with a listbox containing some choices. There
is a "Select" button underneath that runs a macro opening a form that
acts on the selected value.
What I can't figure out is how to display an error, eg. "Please make a
selection" if nothing is selected and the "Select" button is clicked.

I'm trying an If Then Else statement worked into the button such as:
If listbox value=null, then error message. Else, run macro.
This hasnt worked, but it could just be that I don't know how to do it
properly.
The listbox is apparently unbound. (It's choices are derived from the
selection of another listbox)

Thanks in advance,
Josh
 
And then I found the answer somewhere else:

If listindex=-1 Then ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top