X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> Pick from the combo list    
post May 2 2004, 12:37 AM

Utterly Crispy UA Forum Administrator
Posts: 8,791
Joined: 29-September 01
From: Edmonton,Alberta,Canada

You use a combo box to display a list of items from which a user can select one or more. A combo box looks just like a text box, except that it has a down arrow at its right border. To see the combo list, click that arrow to open the control's drop-down list. When you select an item, Access displays that item in the control's text box component. However, you don't have to choose an item from the list--you can type it yourself in the text box component.

To force users to choose from the list instead of entering data themselves, set the combo box's Limit To List property to Yes. The default is No--this setting accepts an entry that's not on the list.

If you choose the No setting, the control accepts entries that aren't in the list; a setting of Yes limits users to the items in the control's list.

If you attempt to enter an item that isn't in the list when you've set the property to Yes, Access displays an error message warning that you can't enter a non-list item. When you receive this message, click OK to clear the message, and then press Esc to delete the offending entry. The error message can be a nuisance, and, fortunately, you can suppress it.

To do so, attach the following code to the control's NotInList property:

Private Sub comboboxname_NotInList(NewData As String, Response As Integer)

Response = acDataErrContinue

End Sub

The next time you enter an item that's not on the list, Access still won't accept the value, but it won't display the error message, either. That's because the acDataErrContinue (intrinsic) constant tells Access to ignore the error and continue.

Edited by: GlenKruger on Mon Apr 17 13:47:48 EDT 2006.
Go to the top of the page

Custom Search

RSSSearch   Top   Lo-Fi    17th November 2018 - 04:28 PM