Combo Box info in a Text Box

Morgandy

Registered User.
Local time
Today, 02:21
Joined
Nov 29, 2008
Messages
42
I'm trying to make two forms, one that will display the information without being able to edit it, and then one that you can pull up to edit or add info. One of my table columns is a drop down box. Is there a way to display that in the read-only version so it looks the same as the rest of the information in text boxes?
 
I'm trying to make two forms, one that will display the information without being able to edit it, and then one that you can pull up to edit or add info. One of my table columns is a drop down box. Is there a way to display that in the read-only version so it looks the same as the rest of the information in text boxes?

I'm assuming that if you convert the combo to a text box that the number will show instead of the text. So, I would just hide the combo box (set the visible property to 0") and then place a text box on your form and set the control source to

=[YourComboBoxNameHere].[Columns](1)
 
Ok I tried doing what you suggested. I typed in the text box control source

=[privateTeacher].[Columns](1)

but when I go to View mode I get the error

#Name?

What now?
 
I suspect Access is confused trying to figure out what [Columns] is!


=[YourComboBoxNameHere].[Columns](1)

should be

=[YourComboBoxNameHere].[Column](1)

without the "s" on Column.
 
Ok thanks, I think I'm getting this....Only thing i am stuck on at moment is what the "Me." is in the sample code.

Private Sub cboTest_AfterUpdate()
Me.txtEmpID = Me.cboTest.Column(0)
Me.txtEmpFName = Me.cboTest.Column(3)
Me.txtEmpLName = Me.cboTest.Column(2)
Me.txtTitle = Me.cboTest.Column(4)
Me.txtDOB = Me.cboTest.Column(5)
End Sub
 
Me is a programming shortcut which refers to the current class object (in this case a form) so you don't have to use the full, qualified name.
 
hum, still not working. Now it is not showing up anything in the text box.
 
you know nm hehe...It's working now! YAY! thanks you two.
 

Users who are viewing this thread

Back
Top Bottom