HiAspire
Technical User
- Oct 17, 2002
- 10
Hopefully this is something simple but has been giving me fits this morning.
We have a combo box on a form that pre-populates all the values based on the selection you make (pulled from a seperate database of options like address, phone #, etc.). Everything has been working fine with it until we have new records that share similar partial account codes.
The account codes you can choose from are in 2 parts (stored in two seperate fields). For example, account code #STORE80015 appears in the database as "STORE" under AcctName and "80015" under AcctZip. Another record might be #SHOP80011 also stored in 2 parts in the database so that it is easier to group and sort by either part of the account code.
Everything has been fine with this until I enter a duplicate partial code (such as #STORE80015 AND #STORE80016 with them both having "STORE" for AcctName).
In my combo box on the form, it will not let me choose any other record other than the first STORE entry. My combo box shows two fields when you pull down (AcctName and AcctZip) but if I select the row with #STORE|80016 it actually uses #STORE|80015 and pre-populates that information instead of the one I chose.
I use an event procedure to populate the other fields on the form after selected, for example:
Me.AcctName = Me.AccountSelect.Column(0)
Me.AcctZip = Me.AccountSelect.Column(1)
Me.AcctAddress = Me.AccountSelect.Column(2), etc.
I was thinking it might be due to the Bound Column for that pulldown being set at 1 which is the AccountName column but it doesn't work at all when set to anything else and works perfectly for selections that do not have duplicate account names. When there are, it only recognizes one of the records with that AcctName and not the actual row you intended to select.
Before I go ahead and restructure the entire database and hundreds of existing records to just use one field for that account code instead of being broken into two, is there a simple fix to this? I haven't messed around with combo box settings too much previously.
We have a combo box on a form that pre-populates all the values based on the selection you make (pulled from a seperate database of options like address, phone #, etc.). Everything has been working fine with it until we have new records that share similar partial account codes.
The account codes you can choose from are in 2 parts (stored in two seperate fields). For example, account code #STORE80015 appears in the database as "STORE" under AcctName and "80015" under AcctZip. Another record might be #SHOP80011 also stored in 2 parts in the database so that it is easier to group and sort by either part of the account code.
Everything has been fine with this until I enter a duplicate partial code (such as #STORE80015 AND #STORE80016 with them both having "STORE" for AcctName).
In my combo box on the form, it will not let me choose any other record other than the first STORE entry. My combo box shows two fields when you pull down (AcctName and AcctZip) but if I select the row with #STORE|80016 it actually uses #STORE|80015 and pre-populates that information instead of the one I chose.
I use an event procedure to populate the other fields on the form after selected, for example:
Me.AcctName = Me.AccountSelect.Column(0)
Me.AcctZip = Me.AccountSelect.Column(1)
Me.AcctAddress = Me.AccountSelect.Column(2), etc.
I was thinking it might be due to the Bound Column for that pulldown being set at 1 which is the AccountName column but it doesn't work at all when set to anything else and works perfectly for selections that do not have duplicate account names. When there are, it only recognizes one of the records with that AcctName and not the actual row you intended to select.
Before I go ahead and restructure the entire database and hundreds of existing records to just use one field for that account code instead of being broken into two, is there a simple fix to this? I haven't messed around with combo box settings too much previously.