Re: need similar solution to "cascading combos"...

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




Hello Larry,

You missed one option that just may be the thing I was looking for: you
can create a user-defined function for the rowsource type property which
allows for virtually any kind of data to populate a combobox, including a
recordset. I found the example for it (mislinked in the help file) on the web
and it looks quite straightforward. If anyone is interested in browsing it,
here's the link.

http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnarofftalk/html/office04062000.asp

Thanks for assistance everyone but I fully expect this to the be solution
that will hold me in good stead.. if not, I'm sure I'll be back on here to
let everyone know :-). And yes, you are right Larry, there are some very nice
aspects to Access which I like very much. That's why I was suprised to find
that I couldn't do something that should be atleast possible, if not obvious.
I learned from Delphi programming that if I sniff around, there usually IS an
easier and better way to do something.

dave

"Larry Linson" wrote:

"David J. Smith" <DavidJSmith@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote

> I'm creating a search form w/ unbound combo boxes
> that create a filter on the subform. Can I use the filtered
> view of the subform as the starting point for my query?
> Like clone that recordset and reference it in code from
> the combo boxes? I'm a newbie in Access so don't know
> VB well enough mess around with recordsets in code yet.

The answer to your basic question is "No, you cannot set the RowSource of a
ComboBox to a Recordset." You can set the Row Source to a Table, a Query,
or a Value List.

However, if you would try to not be so "generic" in your description,
perhaps someone could offer a useful suggestion. Unless you fear that you
are going to reveal a trade secret or confidential data, tell us what data
you have, how it is laid out in tables, and what you are trying to
accomplish.

Also "Filter" is a very specific term in Access, and I think you are using
that in a generic sense, as well. If you were actually using Access' Filter
feature, the solution would likely be different than what you'll need to do
to with Combo Boxes.

What you've described so far is _how_ you want to do something, and you want
to do it in a way that you can't do in Access. But, almost certainly, if
the data content is limited based on one or more Combo Boxes, you _can_
restrict later choices to the already-selected subset... if, indeed, that is
what you want to do. Others, and I, do that frequently.

This may, indeed, be easy to accomplish in Delphi, but Delphi is a
programming language, not a database -- so there'll be more to the "Delphi
environment" than just Delphi, and, AFAIK, there's nothing like Access'
flavor of Combo Boxes available to Delphi. It was possible in classic VB to
emulate the AutoExpand feature of Access Combo Boxes, but it took some
programming to do so -- programming not needed in Access. And, as we say to
many who want Access to be, or to work like, some tool they've used before,
that kind of expectation can lead to nothing but frustration.

We wold really like to be of help, but we need more specific information
than what you provided. Perhaps having the answer to that basic question
will get the discussion "off dead center."

Larry Linson
Microsoft Access MVP



.



Relevant Pages

  • Re: need similar solution to "cascading combos"...
    ... That's not quite the same as setting it to a recordset, but the values are, ... I learned from Delphi programming that if I sniff around, ... > I'm creating a search form w/ unbound combo boxes ... Also "Filter" is a very specific term in Access, ...
    (microsoft.public.access.forms)
  • Re: need similar solution to "cascading combos"...
    ... Like clone that recordset and reference it in code from ... Also "Filter" is a very specific term in Access, and I think you are using ... to with Combo Boxes. ... This may, indeed, be easy to accomplish in Delphi, but Delphi is a ...
    (microsoft.public.access.forms)
  • Re: Filtering records on a form using multiple combo boxes
    ... The goal is to make a valid query statement. ... You can also ask Access to print the string to the Immediate window. ... = page the text boxes are on ... filter the field in the record list box.. ...
    (microsoft.public.access.forms)
  • Scope of Procedures Follow-up
    ... I started programming in the late 1980s with GFA Basic ... a brilliant event driven programming language for the time. ... OS/2, so my next PC was another dual boot machine with OS/2 version 4. ... I had heard of Delphi and found a copy of version 6 on an old Australian PC ...
    (alt.comp.lang.borland-delphi)
  • Re: Filtering records on a form using multiple combo boxes
    ... I have a question about this coding I have 3 combo boxes and alist which ... If I wanted to write this code How would I do it to filter the record ... MarketingCampaignID ... For the Agent Combo Box, ...
    (microsoft.public.access.forms)