If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
List box error
How do I set focus away from a list box? I have 4 list boxes on a tab
control that are interdependant. I.e. the value of one becomes criteria to requery the next. When I requery the 1st list box, I set the focus to it and set the List Index property to have a record selected to use in the second list's query criteria. Then I need to do the same for the 2nd-4th list boxes. The problem is that once I set the focus to the 1st list box, I can't move it. SetFocus to the form executes, but the focus stays on the list box. SetFocus to any other control causes 'Runtime Error 2115: The macro of function set to the BeforeUpdate or ValidationRule property for this field is preventing Microsoft Access from saving the data in the field.' I don't have any functions set for either property |
#2
|
|||
|
|||
List box error
Based on the error you are getting, I am guessing your list box control is
bound to a record source field. I avoid using either combo boxes or list boxes as bound controls. I only use a list box if it is necessary to allow multiple selections. The problem with a multi select list box is that querying the control by name returns Null. Another problem is that using an event like After Update, which would seem the logical place to set focus to the next control, fires every time you make another selection. The user can use the Tab key to move to the next control. So, if your list box does not require multiple selections, I would recommend changing it to a combo box. It is easier to deal with and provides the Auto Expand fucntionality not available in a list box. "4110" wrote: How do I set focus away from a list box? I have 4 list boxes on a tab control that are interdependant. I.e. the value of one becomes criteria to requery the next. When I requery the 1st list box, I set the focus to it and set the List Index property to have a record selected to use in the second list's query criteria. Then I need to do the same for the 2nd-4th list boxes. The problem is that once I set the focus to the 1st list box, I can't move it. SetFocus to the form executes, but the focus stays on the list box. SetFocus to any other control causes 'Runtime Error 2115: The macro of function set to the BeforeUpdate or ValidationRule property for this field is preventing Microsoft Access from saving the data in the field.' I don't have any functions set for either property |
Thread Tools | |
Display Modes | |
|
|