Im running Access 2003.
I created an unbound combobox with 3 columns on a form.
The Row Source is from a table.
Bound Column = 1 and LimitToList = No,,, thus the user can edit the data in the 1st-Column after they selected one of the rows in the combobox.
However, I want to save the data of 2nd-Column and 3rd-Column, because if the user edits the 1st-column, the resulting text might not be in the Row Source, which will result in 2nd-Column and 3rd-Column to go blank.
I thus created two text boxes (TextA and TextB) to store the values of 2nd-Column and 3rd-Column each time the user selects a row from the combobox.
I entered the following code for the Combobox's AfterUpdate event:
Expand|Select|Wrap|Line Numbers
- Private Sub InvoiceDetailCombo_AfterUpdate()
- TextA = [Forms]![Mainform1]![InvoiceDetailCombo].[Column](1) '2nd-Column
- TextB = [Forms]![Mainform1]![InvoiceDetailCombo].[Column](2) '3rd-Column
- MsgBox "After Update" 'Just to make sure the event fires
- End Sub
Then I edit the text in the Combobox.
When I click the mouse on another control, the new edited data in 1st-Column is not found in the Row Source, which results in blanks/nulls being copied to TextA and TextB and the "After Update" message is displayed. Everything OK so far.
But, if I ever-so-lightly click on another control after the 1st-Column's data was edited (as if the combobox only lost focus), the "After Update" message still appears but this time no data is copied to TextA or TextB (you can even test the values of TextA and TextB with a query - they still have their old values).
It appears that the pressure of your finger on the mouse button influences something. However it does not look as if the entire AfterUpdate event was skipped, because my little message still came up - yet TextA and TextB were left unchanged.
It also works the same if you press the right-mouse-button.
What is more... they way the text in 1st-Column was edited also has an influence.
If text is added, TextA and TextB are left unchanged. But if some of the text is deleted, TextA and TextB are updated every time - regardless of left or right button or finger pressure.
I'm dumb folded
Gerhard