Solved Textbox does not always update after combobox selection (1 Viewer)

silentwolf

Active member
Local time
Yesterday, 20:30
Joined
Jun 12, 2009
Messages
565
Hi guys,

came across a issue in my form and would like to get some help please.

In one of my subforms I have a combobox "cboModelType" and a textbox "txtModelType"

The Combobox get its value from a qryModelTypeSorted.

When I select a Model from the combobox I like to place the TypeName into the textbox

In my Textbox I got following =[cboModelType].[column](2)

For some reason it does not update the textbox correctly or better not always, sometimes the textbox gets filled with the Model of my selection.

On some other Models it works so I am not sure why is that and how to be able to fix that.

Hope that is enough Info?

Cheers
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 20:30
Joined
Oct 29, 2018
Messages
21,467
Might be better if you could post a demo db to show the problem.
 

silentwolf

Active member
Local time
Yesterday, 20:30
Joined
Jun 12, 2009
Messages
565
Ok I will put something together :) will take a bit of time and will attach it )

Thanks
 

Gasman

Enthusiastic Amateur
Local time
Today, 04:30
Joined
Sep 21, 2011
Messages
14,265
Hi guys,

came across a issue in my form and would like to get some help please.

In one of my subforms I have a combobox "cboModelType" and a textbox "txtModelType"

The Combobox get its value from a qryModelTypeSorted.

When I select a Model from the combobox I like to place the TypeName into the textbox

In my Textbox I got following =[cboModelType].[column](2)

For some reason it does not update the textbox correctly or better not always, sometimes the textbox gets filled with the Model of my selection.

On some other Models it works so I am not sure why is that and how to be able to fix that.

Hope that is enough Info?

Cheers
I would be checking your data for the combo?
 

silentwolf

Active member
Local time
Yesterday, 20:30
Joined
Jun 12, 2009
Messages
565
Hi I got a sample DB
 

Attachments

  • ComboboxIssue.zip
    82.3 KB · Views: 97

silentwolf

Active member
Local time
Yesterday, 20:30
Joined
Jun 12, 2009
Messages
565
I would be checking your data for the combo?
Well I did but can't seam to see the issue.

And what is strange that it is sometimes working some other selection not.

The issue is on the sfmOrdModels in frmOrdersSingle.

Many thanks for help and taking the time lookin into it for me.

Cheers
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 20:30
Joined
Oct 29, 2018
Messages
21,467
Well I did but can't seam to see the issue.

And what is strange that it is sometimes working some other selection not.

The issue is on the sfmOrdModels in frmOrdersSingle.

Many thanks for help and taking the time lookin into it for me.

Cheers
Hi. Thanks for posting a demo. I think I see the problem. But just to confirm, can you please tell me which item to select from the dropdown that shows the wrong value in the textbox?

Edit: Actually, I think I was able to understand what you mean by wrong value. If I understood it correctly, the problem lies with your bound column not having a unique value. When you have duplicate values in the bound column, the combobox will select the first matching item.

Hope that makes sense...
 

silentwolf

Active member
Local time
Yesterday, 20:30
Joined
Jun 12, 2009
Messages
565
Hi,
the first time it shows the wrong data is Armada 8-Eck so it is the fith down in the dropdown list and serval more..
Edit: Actually, I think I was able to understand what you mean by wrong value. If I understood it correctly, the problem lies with your bound column not having a unique value. When you have duplicate values in the bound column, the combobox will select the first matching item.

oh ok is there a way I can overcome this issue?

As I would love to select the item and show what has been selected in the textbox.

Or is it a set up problem?
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 20:30
Joined
Oct 29, 2018
Messages
21,467
Hi,
the first time it shows the wrong data is Armada 8-Eck so it is the fith down in the dropdown list and serval more..


oh ok is there a way I can overcome this issue?

As I would love to select the item and show what has been selected in the textbox.

Or is it a set up problem?
Hi. To fix the problem, you'll need to add a unique value column to your Combobox and use it as your bound column.
 

silentwolf

Active member
Local time
Yesterday, 20:30
Joined
Jun 12, 2009
Messages
565
Hi thanks for the help!

It works now I had the wront ID Field bound to the column and changed it and now it works as planed!

Cheers
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 20:30
Joined
Oct 29, 2018
Messages
21,467
Hi thanks for the help!

It works now I had the wront ID Field bound to the column and changed it and now it works as planed!

Cheers
Congratulations! Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Top Bottom