"Mo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Allen;
>
> I am looking for some code to filter a listbox using a drop down list. My
> list box shows several columns.
>
> tag_id; TAG; Description; Manufacturer. for example
>
>
>
> I would filter on tagid type where Left string of the first few characters
> will indicate the tag type:
>
> Example:
>
> mm03-ty-01 , m% would indicate a motor (Which have own set of reports);
> left$(Tagid,1) = m
>
> sg01-FY-02 ; S% would indicate a switch. (all back end tables are in SQL
> thus the % for a wild card)
>
> The list is filtered to all possible types that start with an S or M or
> anything else.
>
> Then I would use the Selected items to print a report the related report
> based on the Tag type.(M for motor
>
> Motors have their own report, switches have own reports Etc. Currently
> reports are in word, I'll have to recreate them as access reports as I
> don't know how to print on word document straight from Access. At any rate
> report select/print criteria is based on the type of the element Id or Tag
> ID
>
>
>
> I would appreciate any help with real code example. .
>
> P.S: I have the print selected list items on a single report working fine,
> but not on a designed report in Word. Would it be faster to make these
> word forms into Access reports?
I'm not Allen, and he's somewhat busy at this time, but in the FAQ, you'll
find a topic "Forms: Limit content of combo/list boxes" at
http://www.mvps.org/access/forms/frm0028.htm. And, among my souvenirs at
http://accdevel.tripod.com in "Other Examples", there's "QueryByForm with
Three Combo Boxes -- (Access 97 .MDB format)" to take it one more level
deeper.
Both of these have some "real code".
Generally, we don't do "designed reports in Word" because they are faster or
easier, but because we need the additional formatting features we can use in
Word. Some reports would be much faster to do in Access; others not all
that much faster. If you have the code working to drive Word from Access,
then it seems to me that it'll only be a matter, on the Access side, of
selecting the particular items you want to pass to Word. That's not a very
satisfactory answer, I suspect, but making Word work from within Access is,
IMNSHO, the hardest part.
Larry Linson
Microsoft Office Access MVP