|
-
March 27th, 2001, 07:15 AM
#1
How do you link an item to a item in a combobox
Can someone point me to an example on how to link some items in textbox's to an item in a combo box when it's selected or show how it's done please.
I have five textbox's with variable data in them and they need to associated to an item in the combo.
-
March 27th, 2001, 07:47 AM
#2
Re: How do you link an item to a item in a combobox
Can you clarify your question please.
-
March 27th, 2001, 09:29 AM
#3
Re: How do you link an item to a item in a combobox
This question is not that clear but anyhow, each items in ComboBox has an INDEX associated with it. You can save this INDEX into the TEXTBOX .Tag properties or something like that to link that TEXTBOX with the item in the ComboBox.
-Cool Bizs
Good Luck,
-Cool Bizs
-
March 27th, 2001, 05:58 PM
#4
Re: How do you link an item to a item in a combobox
Ok, thank you Cool Bizs. I'll have a go but do you know if there is an example somewhere?
Thanks
-
March 29th, 2001, 10:36 AM
#5
Re: How do you link an item to a item in a combobox
I can give you a sample code on assigning the INDEX property of the combobox to the TAG property of the textbox but not sure if it applies to what you are doing right now.
private Sub cmbItem_Click()
' assign listindex to the TAG so that we know which item to modify later
if (cmbItem.ListIndex <> -1) then
txtModifyItem.Text = cmbItem.List(cmdItem.ListIndex)
txtModifyItem.Tag = cmdItem.ListIndex
end if
End Sub
private Sub txtModityItem_LostFocus()
' check if text is different from original value
if (cmbItem.List(cint(txtModifyItem.Tag)) <> txtModifyItem.Text)) then
' should confirm if user wants to save changes
cmbItem.List(cint(txtModifyItem.Tag)) = txtModifyItem.Text
end if
End Sub
Hope this helps,
-Cool Bizs
Good Luck,
-Cool Bizs
-
March 29th, 2001, 06:31 PM
#6
Re: How do you link an item to a item in a combobox
Yes, thank you Cool Bizs, That is what i am trying to do. I'll give it a try and see if it will work ok.
Thank you very much.
-
March 31st, 2001, 06:54 AM
#7
Re: How do you link an item to a item in a combobox
Hi Cool Bizs
I have been mucking around with this for the last couple of nights and it's close to what i want i think.
What it's doing is putting the item in the combo box (a company name) into the text box, which isn't quite what i wanted to happen.
What i have is a combo box and five textbox's. The combo holds a company name and the textbox's hold the address of the company, when i select a company name in the combo i want the textbox's to show the address of that company.
I hope that is a little clearer this time.
Your code is close to what i need but i can't quite get it the rest of the way.
Can you help please?
-
April 1st, 2001, 11:58 AM
#8
Re: How do you link an item to a item in a combobox
Sorry for this late reply. Anyway, I've coded a little sample for you:
http://coolbizs.20m.com/CodeGuruHelp...d/ccdriver.zip
Be sure to scan for viruses (i've done that 3 times before i uploaded it to the network) just in case the web space is not virus-free.
-Cool Bizs
Good Luck,
-Cool Bizs
-
April 1st, 2001, 06:30 PM
#9
Re: How do you link an item to a item in a combobox
Hmmm, i get a permmission denied for access when i click on that link, Cool Bizs
Maybe somethings gone funny here, i'll try again tomorow.
-
April 2nd, 2001, 10:36 AM
#10
Re: How do you link an item to a item in a combobox
Send me email personnally and i'll send you the package.
-Cool Bizs
Good Luck,
-Cool Bizs
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
|