Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 4th, 2006, 04:24 AM
Authorized User
Points: 250, Level: 4
Points: 250, Level: 4 Points: 250, Level: 4 Points: 250, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2006
Location: , , Greece.
Posts: 46
Thanks: 0
Thanked 1 Time in 1 Post
Default LIST BOXES

Hi,again
I have a problem with 2 list boxes in the same form!
There is a first list box which shows me an ID number.
There is also an a second list box which shows me in every line, the ID number as above and 3 fields more.
I'm trying when I'm selecting the ID from the first list box to show me in the second list box, only lines with the same ID number.
I'd be grateful if you could answrer me!

Vision G

Reply With Quote
  #2 (permalink)  
Old May 4th, 2006, 04:29 AM
Friend of Wrox
 
Join Date: Dec 2005
Location: CHENNAI, TAMILNADU, India.
Posts: 233
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to anukagni Send a message via Yahoo to anukagni
Default

Hi Vis,

 I got that ur tyr something to do but iam not able to get ur probs please explain a brife to get the issue correctly ..

bye,
pap
Reply With Quote
  #3 (permalink)  
Old May 4th, 2006, 05:04 AM
Authorized User
Points: 250, Level: 4
Points: 250, Level: 4 Points: 250, Level: 4 Points: 250, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2006
Location: , , Greece.
Posts: 46
Thanks: 0
Thanked 1 Time in 1 Post
Default

Look!
There is a table:ID,Last Name,First Name,etc
example
1, Smith, John
1, Idol, George
2, ZZZ, Nick
2, xxx, Alex

I created a form with one list box which shows only the ID 1,2,... only
The same form has and an another list box as the example!
Now I want when I'm selecting from the first list box ID 1
in the second form to show me only
1, Smith, John
1, Idol, George
not
2, ZZZ, Nick
2, xxx, Alex

I think I helped you!
Please now Help ME!!!!

Reply With Quote
  #4 (permalink)  
Old May 5th, 2006, 05:09 AM
Friend of Wrox
 
Join Date: Dec 2005
Location: CHENNAI, TAMILNADU, India.
Posts: 233
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to anukagni Send a message via Yahoo to anukagni
Default

Hi Vis,

  It sounds me little ...SO...u have created an from with ID (i.e. Primary Key form ur Table) and the Other Field (i.e.First & Last Name)... what u did is u uses the list box .. in my side of thinking if u want to take the action as u desire then u have to perfer the combo box and use the synchronise combo box option ...

  That is u should change the first ID list in to combo box and wheh u select the ID number that the data in the corresponding filed ill shown in the below list box ..

http://support.microsoft.com/default...b;en-us;209576

U ill able to get an idea with the above link ..

bye.,
pap
---------------------------------------
Pleasure, gold, fear of life Virtue
Test by these four and trust the true. 2.1.13.501 (Tirukural)

P.A.P.Raguv
Reply With Quote
  #5 (permalink)  
Old May 5th, 2006, 06:30 AM
Authorized User
 
Join Date: Mar 2006
Location: Bratislava, , Slovakia.
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
Place two listboxes (lsbId and lsbShow), then try this:

Private Sub lsbID_Click()
Dim lngListCount As Long
Dim lngCounter As Long
Dim strSelect As String
Dim strWhere As String
Dim strSQL As String

  strSelect = "SELECT ID & ', ' & Name & ', ' & Surname FROM Names"
  strWhere = ""

  lngListCount = Me.lsbID.ListCount

  For lngCounter = 0 To lngListCount - 1
    If Me.lsbID.Selected(lngCounter) Then
      If strWhere = "" Then
        strWhere = Me.lsbID.Column(0, lngCounter)
      Else
        strWhere = strWhere & ", " & Me.lsbID.Column(0, lngCounter)
      End If
    End If
  Next lngCounter

  If strWhere = "" Then
    strSQL = strSelect & " WHERE False"
  Else
    strSQL = strSelect & " WHERE ID In (" & strWhere & ")"
  End If

  Me.lsbShow.RowSource = strSQL
  Me.lsbShow.Requery

End Sub

Reply With Quote
  #6 (permalink)  
Old May 6th, 2006, 04:38 AM
Friend of Wrox
 
Join Date: Dec 2005
Location: CHENNAI, TAMILNADU, India.
Posts: 233
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to anukagni Send a message via Yahoo to anukagni
Default

Hi,

 Weather this possible for combo box ........!?

pls give me an reply,
bye
pap
Reply With Quote
  #7 (permalink)  
Old May 15th, 2006, 04:20 AM
Authorized User
 
Join Date: Mar 2006
Location: Bratislava, , Slovakia.
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try
Peko

Reply With Quote
  #8 (permalink)  
Old May 16th, 2006, 05:04 AM
Friend of Wrox
 
Join Date: Dec 2005
Location: CHENNAI, TAMILNADU, India.
Posts: 233
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to anukagni Send a message via Yahoo to anukagni
Default

I have tried this but iam not getting the result ...
pls any give me an suggesion / clarification for the above issue

pap
Reply With Quote
  #9 (permalink)  
Old May 19th, 2006, 04:04 AM
Authorized User
 
Join Date: Mar 2006
Location: Bratislava, , Slovakia.
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi, you cann't use multiselect property in Combo box, then you must modify some code, if you want select specified ID from ComboBox (cboID) and show detail information in ListBox (lsbShow):

Private Sub cboID_Click()
Dim strSQL As String

  strSQL = "SELECT ID & ', ' & Name & ', ' & Surname FROM Names WHERE ID = " & Me.cboID.Value

  Me.lsbShow.RowSource = strSQL
  Me.lsbShow.Requery

End Sub

or, if you want select ID from ListBox (lsbID) an show details in ComboBox (cboShow), then simply replace last two rows in first example.

Me.lsbShow.RowSource = strSQL --> Me.cboShow.RowSource = strSQL
Me.lsbShow.Requery --> Me.cboShow.Requery


Peko

Reply With Quote
  #10 (permalink)  
Old May 20th, 2006, 07:29 AM
Friend of Wrox
 
Join Date: Dec 2005
Location: CHENNAI, TAMILNADU, India.
Posts: 233
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to anukagni Send a message via Yahoo to anukagni
Default

Hi,

  I want u to clarify one think i.e. I am having tow datatable called Categories & Equipments .. the Equpment table is depend on Categories table ..

 For example the Categorie table contian ..Scientific Equipment , Office Equipment , Electrical Equipment..

 The Equipment table come under the categorie table i.e Air Conditioner for Electrical Equip , Microscope for Scientific Equip & Pen holder for Office Equipment
 
 What i want is in the From view when i select the Equipment name then the Category should come in the Category List box (Equipment name is in Combo box)

 I have entered the Data and the from contains the combo box...!

 if ur not able to understand pls reply me

bye
------------------------
pap...
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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
List Boxes, Help! JeffGirard Access 17 August 22nd, 2005 02:31 PM
Dynamic List Boxes swhite Access VBA 10 September 11th, 2003 02:27 PM
SQL , List Boxes/Menu Boxes, DB's Ginzu3 Classic ASP Databases 1 June 30th, 2003 05:07 AM



All times are GMT -4. The time now is 09:38 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.