dbTalk Databases Forums  

Need help in list box

comp.databases.ms-access comp.databases.ms-access


Discuss Need help in list box in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Wisso
 
Posts: n/a

Default Need help in list box - 04-30-2010 , 08:27 AM






Dear Sirs ,

I have a question and I need your help , it is very urgent please .

I am using Microsoft access 2007 and I have a table called “Type
Table” it contains tow fields : Typecode and TypeName , so when I
have a new type I will add it to this table .

I have a second table called “Etape Table” it contains a several field
and one of these fields called “ type code” (take the data from the
Type Table)

I need to create a form to view all the etapes related to types
that I will select from a list box .
So my question is :

How can I create a list box contains all the type that’s in “Type
Table” and near each type I need to appear a check box , from that I
can click on these check box to select the types that I need to filter
and view all the etapes that related to the types selected ?

Example assuming we have in the type table three value : red, green
and white and I have in the Etape table several etapes related to :
red, green and white

So when I open this list box it appear like trhis
Red check box to select or deselect the red
green check box to select or deselect the green
white check box to select or deselect the white


and after each selection the data appear in the form based on the
selection .

Regards ,

Reply With Quote
  #2  
Old   
Salad
 
Posts: n/a

Default Re: Need help in list box - 04-30-2010 , 09:08 AM






Wisso wrote:
Quote:
Dear Sirs ,

I have a question and I need your help , it is very urgent please .

I am using Microsoft access 2007 and I have a table called “Type
Table” it contains tow fields : Typecode and TypeName , so when I
have a new type I will add it to this table .

I have a second table called “Etape Table” it contains a several field
and one of these fields called “ type code” (take the data from the
Type Table)

I need to create a form to view all the etapes related to types
that I will select from a list box .
So my question is :

How can I create a list box contains all the type that’s in “Type
Table” and near each type I need to appear a check box , from that I
can click on these check box to select the types that I need to filter
and view all the etapes that related to the types selected ?

Example assuming we have in the type table three value : red, green
and white and I have in the Etape table several etapes related to :
red, green and white

So when I open this list box it appear like trhis
Red check box to select or deselect the red
green check box to select or deselect the green
white check box to select or deselect the white


and after each selection the data appear in the form based on the
selection .

Regards ,
I might use an Option group called FrameColor with a default of 0
(since you mention checkboxes instead of a combo) instead. Then add a
Textbox and make it invisible (Called txtColor). It would have a
default value of 0.

Your list box would have a Where clause like
Where ColorID = " & Forms!YourFormName!txtColor

Then when someone clicks on a checkbox, call the Frames afterupdate event.
Select case FrameColor
Case 1
Me.txtColor = 222 'color for Red in table
Case 2
Me.txtColor = 3 'color for Green in table
Case 3
Me.txtColor = 55 'color for Blue in table
End Select
Me.YouListBoxName.Requery

If Combo, set default to 0. The Where would be
Where ColorID = " & Forms!YourFormName!ComboBoxName

and in the afterupdate event of the combo,
Me.YouListBoxName.Requery

Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.