In a form, it has a combobox SelectCustomer and a button btnPrint.
After selecting a customer from the combobox, the SelectCustomer_AfterUpdate sub can display Me.SelectCustomer.Column(1) correctly.
But then I click the Print button, it shows the Me.SelectCustomer.Column(1) as null value.
Code:
Private Sub Form_Open()
With Me.SelectCustomer
.ColumnCount = 2
.RowSource = "SELECT CustNo,CustId FROM Customer ORDER BY CustNo"
.Value = ""
End With
End Sub
Private Sub SelectCustomer_AfterUpdate()
MsgBox(Me.SelectCustomer.Column(1), vbOKOnly)
End Sub
Private Sub btnPrint_Click()
MsgBox(Me.SelectCustomer.Column(1), vbOKOnly)
ProcessReport "Printer"
End Sub