Answered by:
ComboBox Display of value selected

Question
-
I have a subform containing a combobox which gets its members from a table of payment terms.
If a new invoice is being entered, then the user selects the payment term from the combobox.
However, if at somepoint in the future the invoice needs to be edited, the value of the comboxset is set from what has been stored in a table (invoice details).
This all works fine. However, I am trying to find a way to have the combobox actually display the value which I set via VBA just as if I selected the value from the combobox itself.
Here is a standard combobox without a selection purposefully made from the combobox itself.
Here are options
Here is what I want the combobox to display via VBA due to me setting the value behind the scenes.
The user needs to see the value of the combobox. Otherwise, it gives the appearance that no terms have been selected.
Thanks for any advice.
Lance
Tuesday, March 13, 2018 2:46 PM
Answers
-
Hi,
Thanks. What happens if you use something like this instead?
Forms!frmAPInvEntry!frmAPListSub!cmbTerms = Me.PayTerms - 1
Depending on your combobox bound column, the above may not quite get the correct result but it should show you immediately what you tried to assign to the combo. If so, then just adjust it accordingly to make it correct.
Hope it helps...
- Marked as answer by LAxiom Tuesday, March 13, 2018 4:37 PM
Tuesday, March 13, 2018 4:31 PM
All replies
-
Hi Lance,
What does your VBA to assign the value to the combobox looks like?
Tuesday, March 13, 2018 3:38 PM -
Forms!frmAPInvEntry!frmAPListSub!cmbTerms.Selected(Me.PayTerms - 1) = True
Regards,
L.
Tuesday, March 13, 2018 4:23 PM -
Hi,
Thanks. What happens if you use something like this instead?
Forms!frmAPInvEntry!frmAPListSub!cmbTerms = Me.PayTerms - 1
Depending on your combobox bound column, the above may not quite get the correct result but it should show you immediately what you tried to assign to the combo. If so, then just adjust it accordingly to make it correct.
Hope it helps...
- Marked as answer by LAxiom Tuesday, March 13, 2018 4:37 PM
Tuesday, March 13, 2018 4:31 PM -
Thank you. That was the solution.
Lance
Tuesday, March 13, 2018 4:37 PM -
Hi Lance,
You're welcome. Glad we could assist. Good luck with your project.
Tuesday, March 13, 2018 4:47 PM