PC Review


Reply
Thread Tools Rate Thread

Limit or filter a list box on a dropdown list selection

 
 
Mo
Guest
Posts: n/a
 
      19th Jun 2008
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?

Thanks




 
Reply With Quote
 
 
 
 
Larry Linson
Guest
Posts: n/a
 
      20th Jun 2008

"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


 
Reply With Quote
 
 
 
 
Mo
Guest
Posts: n/a
 
      20th Jun 2008
Thanks a bunch ! I guess I would replace the combo box with a" list box.row
source = strSQL"


"Larry Linson" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>
> "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
>



 
Reply With Quote
 
Larry Linson
Guest
Posts: n/a
 
      21st Jun 2008
"Mo" <(E-Mail Removed)> wrote

> Thanks a bunch ! I guess I would replace the
> combo box with a" list box.row
> source = strSQL"


That is certainly an option.

Combo Boxes are more flexible (e.g, with AutoExpand set to Yes, scrolling
the list as you type), and take less screen real estate when not in use;
List Boxes allow (but don't force you to use) multi-select capability and if
you don't have a multitude of options may allow you to show them all, all
the time.

You can implement similar functionality with a Text Box and a Combo/List
Box, but I've never found a real-world situation where it was better to
force the user to type (correctly) than to allow them to type and/or scroll
and choose.

Larry Linson
Microsoft Office Access MVP


 
Reply With Quote
 
Margaret
Guest
Posts: n/a
 
      6th Jul 2008
Please visit (E-Mail Removed)/blog
I am starting up a business and need new customers. Any help that you could
give me, I would really appreciate it. Im not spaming anyone, so please let
me know if there are anyone you know who lives in the london area and would
be interested in the purchase of medical uniforms.

Im trying to get as many customers as i can. i need help tho. Please pass
this email on to whom ever you know who would be interested. I would really
appreciate it.

Here is a little about it:

We are a business that makes Medical Uniforms which are made for Nurse's,
Doctors, and any Medical team that there is out there like PSW's.

You can find more out about it at: (E-Mail Removed)/blog

We have flexible plans to accommodate growth. All size's, styles and colors
that you can think of

We are located in London, Ontario

Thank you for your time.

Margaret

"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?
>
> Thanks
>
>
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setup dropdown list that selection references another dropdown Denny Microsoft Excel Programming 1 24th Mar 2010 01:37 AM
Limit or filter a list box on a dropdown list selection Mo Microsoft Access Forms 4 6th Jul 2008 04:56 PM
filter: how to print filter list options in dropdown box =?Utf-8?B?aGVscCBwbGVhc2U=?= Microsoft Excel Misc 2 17th Oct 2007 01:53 AM
limit one list box data set based on selection in another list box WB Microsoft Access Forms 3 10th Oct 2007 10:13 PM
limit cell list selection based on the selection of another list =?Utf-8?B?bG9ycmFpbmU=?= Microsoft Excel Worksheet Functions 2 14th Dec 2004 09:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:09 PM.