Re: "prompted selection" ?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Jay Freedman (jay.freedman_at_verizon.net)
Date: 05/05/04


Date: Wed, 5 May 2004 10:48:07 -0400

The behavior you described is controlled by the .MatchEntry property of the
ComboBox or ListBox control. The possible values, as listed in the Help,
are:

fmMatchEntryFirstLetter = 0
Basic matching. The control searches for the next entry that starts with the
character entered. Repeatedly typing the same letter cycles through all
entries beginning with that letter.

fmMatchEntryComplete = 1
Extended matching. As each character is typed, the control searches for an
entry matching all characters entered (default).

fmMatchEntryNone = 2
No matching.

I don't have a Macintosh to look at, but it's possible that the controls
there default to one of the other two values -- probably
fmMatchEntryFirstLetter, or 0 -- instead of fmMatchEntryComplete. You can
put a statement like this in either the UserForm_Initialize() or the
UserForm_Activate() procedure to force it to match the way you want:

   cbxList.MatchEntry = fmMatchEntryComplete

-- 
Regards,
Jay Freedman
Microsoft Word MVP          FAQ: http://word.mvps.org
Old Lars wrote:
> In a template that I've inherited there are lots of selection box
> forms. These forms have the behaviour that when the user begins typing
> a value in the entry field, the list below the field scrolls down to
> the first entry that matches what's been typed so far, and the entry
> field fills itself in with that value as well. As more of the desired
> value is typed in, this "prompted selection" refines itself to a more
> precise match among the available values, if possible.
>
> So as I begin by typing "c", the first entry in my list, "CAP", pops
> up. (The list also scrolls to that "CAP", if I have the list visible.)
> Then, as I continue with the next letter, "h", the prompted entry
> switches to "CHAP". Next, I type "i", and the entry switches to
> "CHIN". And so on.
>
> I have two questions:
>
> 1) What is this behaviour called? I've been using it for years and
> find it useful, but I don't know how to refer to it.
>
> 2) Why does this work on Windows but not on Macintosh? (It's exactly
> the same template, carefully written to be dual-platform.)
> Specifically, it's always worked on versions of Word, from Word 2000
> back to at least Word 95, but never on Mac, from Word 2001 back to
> Word 6.0. (Those are the versions that I've had on my PC and Mac.) I
> don't know if I did anything special to enable it, either as a user or
> as the hack programmer trying to hold this template together.
>
> Thanks ---


Relevant Pages

  • "MatchEntry" propery for list.
    ... This is description of the function of the MatchEntry property ... for a ComboBox control. ... matches the user's typed entry. ... VBA determines an unambiguous match after 2 letters, ...
    (microsoft.public.word.vba.general)
  • Re: Repost: DoCmd.RunCommand acCmdDeleteRecord does nothing.
    ... If you are seeing that error, it must be due to the fact the the control ... currently contains an invalid or unacceptable entry (such as an incomplete ... to delete a record with a required field set to null, ... DoCmd.RunCommand acCmdDeleteRecord ...
    (microsoft.public.access.formscoding)
  • Re: Problem with Return Value from a Function
    ... The function reference transfers control to a function procedure; the function procedure returns control and a value, which replaces the function reference in the evaluation of the expression. ... ENTRY variables cannot be returned unless they have the LIMITED attribute. ... The CALL statement can be used to invoke it only if the returned value has the OPTIONAL attribute. ...
    (comp.lang.pl1)
  • Re: Restricting subforms entry before mainform
    ... Next, in the property dialog box for the selected control, with the Events ... there should be an entry like the one below for each of the ... controls on your form except the AutoNumber field. ... before allowing data entry in the subform? ...
    (microsoft.public.access.forms)
  • RE: Lookup problems
    ... I was able to resolve this problem by doing the following: ... Remove the combo box control from the form. ... typing in an entry works, ... "Keith" wrote: ...
    (microsoft.public.access.forms)