A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

List box error



 
 
Thread Tools Display Modes
  #1  
Old August 22nd, 2006, 07:34 PM posted to microsoft.public.access.forms
4110
external usenet poster
 
Posts: 24
Default 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  
Old August 22nd, 2006, 08:19 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:03 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.