I have a bit of code in the OnCurrent event in a form which brings the value from a third column in a table into a text box when a value is selected in a combobox. The code might be written:
Me.txtDisplayColumn3Value=Me.cboInput(2)
I put this into the OnCurrent event because I need this information to display in this box whenever the form opens, no matter whether the value in cboInput has been changed or not.
This works exactly the way I want it to (of course, specific field names changed to bow to my company's para...um...high level of concern about privacy).
However, I have another database I'm creating specifically to use as an example for another set of questions I need to ask. In this database, because I'm using multiple values (I know...some don't like them. Not interested in that feedback.), I have a list box to obtain the information from the input which I want to use to populate two textboxes. I'm going to attach this database here, but here's the code (in the OnCurrent event of the form):
CODE:
Private Sub Form_Current()
Me.txtOffice = Me.lstDepartment.Column(1)
Me.txtBuilding = Me.lstDepartment.Column(2)
End Sub
The table that lstDepartment is pulling from has three columns. What's happening is that the first column information shows up in both textboxes, completely ignoring, it appears, the "Column" part of the code. Any ideas?