A
Adrian Parker
Version: Access 2000
Hello. I have a table with three fields. An autonumbered field which is a
primary key. A Text field called "schoolName", and another text field
called "contactName"
In the table, I set the Display Control of the schoolName to Combo Box (I've
also used Text Box). I make a new form. On this form there is a text box
to show the primary key, a text box to show the contact name, and a combo
box to show the schoolName. The control source for schoolName is schoolName
(which is correct)
When I view the form in form view, I find the Combo Box is filled with the
primary keys! Not the value I wanted.
If I add a Text Box to the same form, and also set it's control source to
schoolName, the text box now shows the primary key, and the combo box shows
the school's name (As it should). When I use the form in this state, and
scroll through records, the schoolName field value for every record is
changed so that it's value becomes that of it's own primary key!
Also, I put a bound text box on the form, pointing to schooName, and then an
unbound combo box. In the combo box's onchange method I put:
txtSchoolName.text = cmbSchoolName.Text
(note: both object names are correct) This returns an error saying you
can't change the property of a control which does not have focus!
What is going on? I know VB quite well, and SQL very well. So generally I
know what I'm doing. But Access seems extremely borked.
Adrian
Hello. I have a table with three fields. An autonumbered field which is a
primary key. A Text field called "schoolName", and another text field
called "contactName"
In the table, I set the Display Control of the schoolName to Combo Box (I've
also used Text Box). I make a new form. On this form there is a text box
to show the primary key, a text box to show the contact name, and a combo
box to show the schoolName. The control source for schoolName is schoolName
(which is correct)
When I view the form in form view, I find the Combo Box is filled with the
primary keys! Not the value I wanted.
If I add a Text Box to the same form, and also set it's control source to
schoolName, the text box now shows the primary key, and the combo box shows
the school's name (As it should). When I use the form in this state, and
scroll through records, the schoolName field value for every record is
changed so that it's value becomes that of it's own primary key!
Also, I put a bound text box on the form, pointing to schooName, and then an
unbound combo box. In the combo box's onchange method I put:
txtSchoolName.text = cmbSchoolName.Text
(note: both object names are correct) This returns an error saying you
can't change the property of a control which does not have focus!
What is going on? I know VB quite well, and SQL very well. So generally I
know what I'm doing. But Access seems extremely borked.
Adrian