Test List Box

G

Guest

Hello:

On my form I have a 2 list boxes.

When the user selects value from the first box the table's field called
Selected is updated to Yes value in the table. The second box row source is
based on that table and shows the Selected fileld values.

I need to test for null values to make sure that values were selected by the
user before I run my report.
Is there a way to test and refrence 2 nd list box for null values Inothing
selected)?

I hope, this is clear - would appreciate your help.
 
A

Arvin Meyer [MVP]

Sub MyButton_Click()
If Len(Me.List2 & vbNullString) > 0 Then
DoCmd.OpenReport "rptWhatever",,,,"ID =" & Me.List2
Else
MsgBox "Select a value in List2", vbOKOnly, "Error"
End If
End Sub
 

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

Top