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 |
#11
|
|||
|
|||
Filtering Data On Entry
Allen Browne has a sample Find As You Type.
http://allenbrowne.com/AppFindAsUType.html iain wrote: Thanks Ken, this is quite a lot for me to work on, so it'll take some time before I get it working, but I'll give it a whirl. Iain -- Please Rate the posting if helps you. Message posted via http://www.accessmonster.com |
#12
|
|||
|
|||
Filtering Data On Entry
Well Ken, I've had a go at this and it is very close to what I'm trying to
achieve. The 'Find as you Type' function is probably what I need in the long run but I've read it and it is way beyond my capabilities and understanding. I'm having the following difficulties with your suggestion: The form name is frmContents and the field name is Subjects, and the form module now has 3 private subs for each of the events. As soon as I opened the form after adding the list box, I now get a message box popping up "Enter Parameter Value" i.e. frmContents!Subjects. I have to click the cancel button on the message box, three times before the form is displayed. The same thing happens when I try to type anything in the field. This list box only filters the choice after I type everything I want into the text box, but not as I type each character. Any further suggestions? Iain "KenSheridan via AccessMonster.com" wrote: Iain: A combo box works in a slightly different way than that which you describe as it progressively goes to the nearest match in its list as characters are entered rather than progressively restricting a list to a set of possible values. To do the latter you'd need to use two controls, a bound text box and an unbound list box. The list box would have a RowSource property such as: SELECT DISTINCT MyField FROM MyTable WHERE Myfield LIKE Form!MyTextBox & "*" OR Form!MyTextBox IS NULL ORDER BY MyField; where MyField is the name of the field in question, and MyTextBox is the name of the text box to which it is bound. Note the use of the Form property to refernce the form rather than a full reference; this is possible as both controls are in the same form. In the text box's Change event procedure requery the list box: Me.MyListBox.Requery Do the same in the form's Current event procedure. In the list box's AfterUpdate event procedure assign its value to the text box: Me.MyTextBox = Me.MyListBox You can if you wish show the list box in the text box's GotFocus event procedure and hide it in both the text box's and the list box's AfterUpdate event procedure, though in the latter you'd also have to move focus to the text box first: Me.MyTextBox.SetFocus Me.MyTextBox = Me.MyListBox Me.MyListBox.Visible = False Ken Sheridan Stafford, England iain wrote: I'm trying to speed up data entry on a form in such a manner that when I enter the first character in a field, it displays a list of all previously stored values that begin with that character, then reduce the number of choices as I type each character. If the string that I want to enter is already listed I wish to select it using the mouse, otherwise type a completely new string and use the enter key or tab to the next field. Can this be achieved with a Combo Box? Does anyone onow of usefull links where I might find more information on this technique? Thanks, Iain -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...arted/200909/1 |
#13
|
|||
|
|||
Filtering Data On Entry
Iain:
I think you may have missed out the reference to the Forms collection in the parameter. It should be either: Forms!frmContents!Subjects or simply: Form!Subjects The former is a fully qualified reference to the Subjects control. The In the latter 'Form' is the form's Form property. This can be used in cases like this where the referencing control (the list box in this case) is in the same form as referenced control (the Subjects text box). Ken Sheridan Stafford, England iain wrote: Well Ken, I've had a go at this and it is very close to what I'm trying to achieve. The 'Find as you Type' function is probably what I need in the long run but I've read it and it is way beyond my capabilities and understanding. I'm having the following difficulties with your suggestion: The form name is frmContents and the field name is Subjects, and the form module now has 3 private subs for each of the events. As soon as I opened the form after adding the list box, I now get a message box popping up "Enter Parameter Value" i.e. frmContents!Subjects. I have to click the cancel button on the message box, three times before the form is displayed. The same thing happens when I try to type anything in the field. This list box only filters the choice after I type everything I want into the text box, but not as I type each character. Any further suggestions? Iain Iain: [quoted text clipped - 56 lines] Iain -- Message posted via http://www.accessmonster.com |
|
Thread Tools | |
Display Modes | |
|
|