Combobox not displaying data with after update function

  • Thread starter Thread starter Angel G
  • Start date Start date
A

Angel G

I have a combo box in an ADP database with an After Update function as
follows:

Private Sub PartNumberTestcbx_AfterUpdate()
Forms![AMC_PartNumberTests].RecordSource = "SELECT AMC_PartNumberTests.*
FROM AMC_PartNumberTests WHERE PartNumberID = '" & [PartNumberTestcbx] & "'"
Forms!AMC_PartNumberTests.Requery
DoCmd.GoToRecord , , acLast
Detail.Visible = True
End Sub

All works but the problem is that the combo box does not display the value
selected at times. It is blank, but if you put the cursor in it, it displays
it. Does any one know how to correct this issue?
 
I don't have a solution for you.

There is a very long-standing bug in Access where it fails to display the
value correctly in some cases. It only happens when the combo's display
column is not the bound column, and it seems to be a timing issue, i.e.
Access paints the form before loading the value to display in the combo.

You can't solve it by adding a Repaint to the form's Current event. In the
dim recesses of my mind, there was a quirky workaround that involved adding
a text box that partly overlapped the combo, and using transparency to trick
Access into repainting the combo, but I can't recall the exact details.

(This assumes the problem is not merely that you have limited the combo's
RowSource in such a way that it does not have the value to display.)
 
Back
Top