Referencing column(1) in a text box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Novice

I entered data directly into a table by using a lookup on the field:

SELECT tblContinentsGlobal.ContinentID, tblContinentsGlobal.Continent FROM
tblContinentsGlobal;

Bound column: 1

Columns: 2

The data went into the field: ContinentA

I did it this way because this is a (FYI) field that users can't modify on
the form.

Problem is, on my form: fsubDestinationsGlobal, the text box: txtContinentA
displays the ContinentID and not the text. I tried to use .column(1) to
display the text, but it appears that this doesn't work in a text box. Do I
have to change the text box to a combo box or is there another way to do this?

Any suggestions please?

Peter
 
Hi, Peter.
I entered data directly into a table by using a lookup on the field:

You should not be using the table for data entry, since the table can't do
the same type of data validation and manipulation that the events of a form
can. Only enter data via a form which is bound to a query. You should also
not be using Lookup Fields because they cause so many problems. Please see
the following Web page for more information:

http://www.mvps.org/access/lookupfields.htm
I did it this way because this is a (FYI) field that users can't modify on
the form.

Use the control's Locked Property to prevent users from modifying data. Or
use a Snapshot type Recordset for the form's Record Source if the whole form
is "read-only."
Do I
have to change the text box to a combo box

This depends upon what the purpose is. Use Continent as the Control Source
of the text box to see this field in the current record. Otherwise, you
could use a combo box or list box to select one of many continent names in
the table. Only a combo box or list box can hold the contents of the results
of a SELECT query, because they're designed to hold multiple rows and
multiple columns, whereas a text box is designed to display a single field
for the current record.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact info.
 
Back
Top