Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box to Update Two Other Combo Boxes? 1

Status
Not open for further replies.

JonWolgamuth

Technical User
Apr 19, 2001
53
US
I created a database quite a while back that has multiple combo boxes for the users to select "Reported By", "Analyst Assigned", and "Tester Assigned".

What we've discovered after using the database for a while is that these three fields are often, but not always, the same person.

It was suggested that I update the database to update the "Analyst Assigned" and "Tester Assigned" based on the "Reported By" combo box.

I'm currently using the following code:

****

Private Sub Reported_cbo_Change()

Me.Analyst_cbo.SetFocus
Me.Analyst_cbo.Text = Me.Reported_cbo.Column(1)

Me.Brief_Description.SetFocus

End Sub

****

When I do this, I get the following error. "Runtime error 2185 - You can't reference a property or method for a control unless the control has the focus."

Can someone point out what I'm doing wrong, or if there is a better way to go about this??

Thanks!
 
Do your combo boxes have a hidden 'column 0' containing the record ID? If so, try:
Code:
Private Sub Reported_cbo_Change()

Me.Analyst_cbo.SetFocus
Me.Analyst_cbo = Me.Reported_cbo

Me.Brief_Description.SetFocus

End Sub

If not, try:
Code:
Private Sub Reported_cbo_Change()

Dim txtName as String

Me.Reported_cbo.SetFocus
txtName = Me.Reported_cbo.Column(1)

Me.Analyst_cbo.SetFocus
Me.Analyst_cbo.Text = txtName

Me.Brief_Description.SetFocus

End Sub
One of these should work.

Bob Stubbs
 
Perfect. The first solution worked. Thanks for taking the tiem to help me, Bob!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top