VB "CE" ComboBox question

On a Visual Basic "CE" form I have a ComboBox that contains some ID numbers.  What I want to happen is for the user to select an ID and have the other text boxes on the form be filled in.  But I can't figure out how to do this.  Currently the only way I can get the other text boxes to fill in, is to have the user click on one of the text boxes on the screen after selecting the ComboBox's ID.  I want to eliminate this second step.

The ComboBox's Click, Got_Focus and Lost_Focus events do not seem to be the appropriate events to incorporate the logic to fill in the rest of the text boxes.  (The ComboBox's ID field "ComboBox1.Text" does not seem to be resolved/filled in until after the Lost_Focus is done and another text box has the focus.)
eyoungAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

VbmasterCommented:
Why is the Click event not a "appropriate event"? Don't know about VB "CE" but in regular VB that would be a good place to add the code "textbox.Text = Combobox.Text" or "(textbox.Text = ComboBox.List(Combobox.Listindex))"..
0
eyoungAuthor Commented:
Vbmaster,

Good question.  I also would think the Click event would be the correct event to place the "textfield.text = ComboBox.text" code.

It appears that the ComboBox.text is null when the Click event is occuring.  At least in VB CE.

I have placed a MsgBox at the start of the Click event and at the end of the Click event to show the contents of the ComboBox.text and both times the ComboBox.text is null.

Because of that I have also tried using the Lost_Focus event and the same thing occurs.  

In regular VB, does the Click event contain the new value that has been clicked upon?

Any assistance would be appreciated.

Regards,
EYoung
0
SiM99Commented:
You say that the user clicks on the textbox after selecting the list item, and the value updates.....

Why not just do this:

On the list_click event -
text1.text=list1.text
text1.setfocus
list1.setfocus
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

eyoungAuthor Commented:
SiM99,

The "List1.text" in the command "text1.text=list1.text" would result in List1.text containing a null.  Then setting focus to the text1 box then back to the list1 combobox I think would be confusing to the user.

What I want to have happen is when the user clicks on an item in the ComboBox, I want the text boxes on the form to be filled in.  I need the clicked value from the ComboBox in order to select the appropriate text box values.

I would appreciate any suggestions you may have.  

Thanks,
EYoung
0
SiM99Commented:
"Currently the only way I can get the other text boxes to fill in, is to have the user click on one of the text boxes on the screen after selecting the ComboBox's ID.  I want to eliminate this second step."

Ok, so the user selects the item in the combo box, then you click on the textbox, giving it focus. This works, right ?

Why is this working ?
I assume you have the combobox and the text field on a form togethor, and that you have some code in either the textbox Click event or the GotFocus Event.
If this is so, then you can emulate the event in VB code...

Simply put this (or modify it 1st :) into the combo_click event:
(To emulate the Click event)
private sub Combo_Click(whatever is here)
    text1_click
end sub

(To emulate the GotFocus event)
private sub Combo_Click(whatever is here)
    text1.SetFocus
end sub

You say this will confuse the user ??
Why would that be ? They wont even notice the cursor going into the textbox (or is CE really slow ?)

SiM99
0
eyoungAuthor Commented:
SiM99,

Sorry for the delay in getting back to you.  The project has been put on hold for a while so I will not be able to get an answer to your suggestions.

Please convert your comment to a proposed answer and I will accept the answer so you can get the points.

Happy Thanksgiving to you,
EYoung
0
SiM99Commented:
Thanx EYoung :)
no problem about the delay, just thought you might have given up though :|

"Currently the only way I can get the other text boxes to fill in, is to have the user click on one of the text boxes on the screen after selecting the ComboBox's ID.  I want to eliminate this second step."

Ok, so the user selects the item in the combo box, then you click on the textbox, giving it focus. This works, right ?

Why is this working ?
I assume you have the combobox and the text field on a form togethor, and that you have some code in either the textbox Click event or the GotFocus Event.
If this is so, then you can emulate the event in VB code...

Simply put this (or modify it 1st :) into the combo_click event:
(To emulate the Click event)
private sub Combo_Click(whatever is here)
    text1_click
end sub

(To emulate the GotFocus event)
private sub Combo_Click(whatever is here)
    text1.SetFocus
end sub

You say this will confuse the user ??
Why would that be ? They wont even notice the cursor going into the textbox (or is CE really slow ?)

SiM99
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.