|
-
Sep 26th, 2000, 10:22 AM
#1
Is it possible under certain conditions to adjust the list property with the combo box? What I am trying to say is that if the user clicks on a command button and then clicks on the combo box, only certain items on the list property will be shown.
Thank You for any help.
-
Sep 26th, 2000, 10:28 AM
#2
Lively Member
-
Sep 26th, 2000, 10:33 AM
#3
If you are populating the box from a table-based query, you could write an update query in the code for the command button.
Assume that the following populates the box:
Select yyy from xxx where left$(yyy,1) <> (some unique char)
Then
UPDATE xxx SET xxx.[yyy] = (some unique char) & [yyy]
WHERE (((where condition));
Now requery and you should have something like what you want.
Good Luck
DerFarm
-
Sep 26th, 2000, 10:36 AM
#4
I like Anakim's answer better than mine. I would take it one step further, tho, and hide the master, populating the slave as everything from the first. In that way you wouldn't need "exception" processing, and it would be easier to stack conditions.
DerFarm
-
Sep 26th, 2000, 10:38 AM
#5
New Member
Originally posted by Mikey H.
Is it possible under certain conditions to adjust the list property with the combo box? What I am trying to say is that if the user clicks on a command button and then clicks on the combo box, only certain items on the list property will be shown.
Thank You for any help.
Hi!
1. Bild a query from the DB where you have the Item for the box with them you then fill the combobox
Private Sub cboKlasse_Click(Area As Integer)
'Combo-Box neu befüllen
deHFL.cmdKlasseSelectKurs criteria
Set cboKlasse.RowSource = deHFL
cboKlasse.RowMember = "cmdKlasseSelectKurs"
cboKlasse.ListField = "KlassenName"
End Sub
-
Sep 26th, 2000, 10:38 AM
#6
Thanks Guys. I'll check out that Master / Slave thing. Would it be to much to ask for an example, being that I'm A newbie?
-
Sep 26th, 2000, 10:53 AM
#7
Lively Member
Private Sub cmdButton_Click()
'assuming we're taking everything beginning with an "A"
'from the master
' I'd go along with DerFarm and have the master always
' invisible (saves changing visibility at run-time)
Dim iIndx As Integer
'remove all existing items from the slave.
cboSlave.Clear
For iIndx = 0 To cboMaster.ListCount - 1
If UCase(Left(cboMaster.List(iIndx), 1)) = "A" Then
cboSlave.AddItem cboMaster.List(iIndx)
End If
Next
End Sub
Hope that helps you along the way.
One thing I'd like to know though... is how can I get the above code to appear 'vb' like? Seen it on shed load of other replies around the site.
Anakim
It's a small world but I wouldn't like to paint it.
-
Sep 26th, 2000, 11:12 AM
#8
Thanks Anakim. I'll try it. I don't know how to make the code above look vb-like.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|