Fill Up TextBox with Combo

Dina01

Registered User.
Local time
Today, 22:32
Joined
Apr 24, 2002
Messages
87
Hello I have a form and I also created a ComboBox named "ComputerName" and a textbox named " CompCycle"

These fields are both independent, I also create a functionthat when the formis opened I can see the computer Name of the PC.
What I would like to do is that I would like to link both combobox and text box.

For example if my computer name is MAFD900VC well I should be able to see the cycle in the textbox...I do not want to link the form to the table....

My table name is ComputerName_tb
My SQL statement for theh combo box is

SELECT ComputerName_tb.ComputerName, ComputerName_tb.CompLocation, ComputerName_tb.CompCycle
FROM ComputerName_tb;



I added the following code in my open form event...

Me.CompCycle = Me![ComputerName].Column(2)

but I keep on getting a Null value....

Does anyone know how to do this
 
1) Is CompCycle a bound field?
2) Why not make the text box an unbound field and have an expression like

=Me!MyCombo.MyColumn
as the Recordsource, rather than triggering an event on opening the form?
 
Hello,

I entered Me![ComputerName].Column(2) in the recordsource, but when I run it it doesn't work.....It doesn't put the info in the textbox......I get error with the name... #Name?
 
Last edited:
What is the Name of your ComboBox? Not ComputerName , surely?
 
Ok. The RecordSource of the Text box should be set to:

=[ComputerName].Value (ME! not necessary)

The combo box should have its bound column set to 2, but the computer name (presumably column 1) should be displayed in the combo box (i.e. it should have a column width great enough for it to be properly displayed)

If you still get problems, I'll post a sample...
 
Thank You so much, That worked.....


Thank you again
 

Users who are viewing this thread

Back
Top Bottom