combo box/database combo box vlaue question - newbie 
Author Message
 combo box/database combo box vlaue question - newbie

Hello! I'm doing some form validation. I know how to do this with text
boxes, but it's not working with combo boxes.

I tried:

if cboday.text = " " then
    msgbox "You must choose a day"
    cboday.setfocus
end if

It works in text boxes, how do I insure something was chosen in a combo box?
It skips right over it like it wasn't there.

Thanks,

--
Dave



Sun, 14 Jan 2001 03:00:00 GMT  
 combo box/database combo box vlaue question - newbie


Quote:
>Hello! I'm doing some form validation. I know how to do this with text
>boxes, but it's not working with combo boxes.

>I tried:

>if cboday.text = " " then
>    msgbox "You must choose a day"
>    cboday.setfocus
>end if

>It works in text boxes, how do I insure something was chosen in a combo box?
>It skips right over it like it wasn't there.

>Thanks,

>--
>Dave


 Dave,

Check against the .ListIndex property.  If a value was not selected, this property will equate to a -1; if a value is
selected, the property will equate to whatever the list value is for the item selected.

-Richard



Sun, 14 Jan 2001 03:00:00 GMT  
 combo box/database combo box vlaue question - newbie
Quote:
>Check against the .ListIndex property.  If a value was not selected, this

property will equate to a -1; if a value is

Quote:
>selected, the property will equate to whatever the list value is for the
item selected.

>-Richard

It worked for the combo box, but not the DBcombo box.

If dbcday.listindex = "-1" then
    nok = false ' Don't update the record.
end if

Any idea on how to check the DB combo box?
"Object doesn't support this property or method."

thanks, Dave



Mon, 15 Jan 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. enter data in a combo box based on value from another combo box

2. Limit subform combo box by selection in parent combo box

3. Want Access combo box to filter rowsource of another combo box

4. Populating a combo box from another combo box

5. Populate a combo box from another combo box selection

6. selecting records for 2nd combo box dependant on first combo box

7. Help filling second combo box from fist combo box

8. Combo box selection narrows next combo box choices

9. load 2nd combo box - depend on first combo box

10. Setting Combo box ListIndex initiates Combo box Click event

11. Combo Box like Data Bound Combo Box?

12. Help filling second combo box from first combo box

 

 
Powered by phpBB® Forum Software