Pasting text into a combo-box for browsing

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

From: Gary Schuldt (garyschuldt_at_comcast.net)
Date: 09/15/04


Date: Tue, 14 Sep 2004 18:08:48 -0700

Here's the situation:

I have a garden plant database. I'm trying to improve the searching
functionality on it.

I have a form based on a query that displays botanical name (txtBotName) and
common name.

The Botanical Name is the concatenation of Genus, Species, and Variety
names. The query does this concatenation and is sorted ascending on
Botanical Name.

I want to find and display a record that contains a specified search
word/phrase (e.g., coral) in any of those fields (essentially Botanical Name
and Common Name).

So far, so good: I can clunk through this with Edit->Find and locate the
record I want, and do FindNext to look at another one.

However, in many cases the user will want to directly browse the Botanical
Names surrounding the one found by FindRecord. To do this, I added to the
form an unbound combo box cbxBrowseBotName whose control source is the same
as that of the form, and the only column in it is the Botanical Name.

To browse, I do all this with the mouse after Finding a record: I highlight
the txtBotName value, Ctrl-C, highlight cbxBrowseBotName value, Ctrl-V and
then hit the drop-down arrow and . . . Voila! I see the nearby Botanical
Names in the drop-down. I have an AfterUpdate event on the cbx to find the
any newly selected record, and that works fine.

It seems, though, that I should be able to produce the cbx dropdown either
using a macro or VBA code without all that highlighting and cutting and
pasting, but I can't figure out how to do it.

I need some help with that. Or, if you see a better way to achieve the same
functionality, I'd sure be open to that as well!

TIA

Gary



Relevant Pages

  • Re: Parameter Query Form Problem
    ... This is what I used to make my query, its was a Microsoft support site. ... controls on the form so it can run the query. ... ContractStartDate ... Combo Box for searching Customer Name ...
    (microsoft.public.access.formscoding)
  • Re: Parameter Query Form Problem
    ... Dim stDocName As String ... This is what I used to make my query, its was a Microsoft support site. ... controls on the form so it can run the query. ... Combo Box for searching Customer Name ...
    (microsoft.public.access.formscoding)
  • Re: Help with Union & lookup
    ... I don't see where you are searching the surname field in the query you posted. ... BTW that "LIKE" expression I'm using works fine in another SQL query but with 3 sets of brackets. ...
    (microsoft.public.access.queries)
  • Re: Access General Inquiry
    ... Form_BeforeUpdate for record validation, ... a table or query as datasource. ... Or the form would load with empty fields, ... datatable or query as a recordsource with wizard functionality built into ...
    (microsoft.public.access.forms)
  • Re: How many companies are buying new AS400s
    ... 2x...for one query anyhow. ... think I'm going to be spending a lot of time customizing web ... still run...but only as a DB2 UDB database with ODBC functionality. ... businesses running Linux and Windows for all of their businesses ...
    (comp.sys.ibm.as400.misc)