Text boxes on Forms

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

Guest

I am trying to program a command button to show text in an unbound text box
when clicked. The text is stored in a field in a table. Is there a way of
referencing the text in the table field and showing it in the textbox on the
form?
 
Include the table in the form's Record Source query, and bind the text box
to that field. Lock the text box if you don't want people to change the
value.
 
Thanks BruceM for responding. Doesn't quite do what I need (I think). My
fault - I need to explain more fully what I am trying to do.

I have a form with four command buttons on it. Each button is a particular
employee position i.e. Secretary, Manager, Sales Rep, and so on.

I have an unbound text box next to the four buttons. When I click a button
I would like the name and contact details of that person to appear in the
text box. Maybe I am using the wrong thinking or controls to do this task -
I am after all a new user.

If anyone is able to help it would be appreciated. Thank you.
 
You may do better to use a combo box or list box, but I will need some
details before I can offer a targeted suggestion. Is the form bound to a
table or query? If so, what information is being stored? What is the
connection (relationship) between that information and the employee
position?
In general you could make a query that includes information from the
Employee table. For now I'll just say that information includes EmployeeID,
Title, LastName, FirstName, and Phone, in that order. Use that query as the
Row Source for a combo box (select the combo box, click View > Properties,
click the Data tab, click the Row Source line, and select the query). While
you're at the Data tab, set the Bound Column to 1. Click the Format tab and
set the combo box Column Count to 5 and the column widths to something like
0";1.5";0";0";0". When you switch to form view you should see the Titles
(Secretary, etc.).
Call the combo box cboTitle (or whatever). In an unbound text box, set the
Control Source to =[cboTitle].Column(4). When you select the title in the
combo box, the text box should show the Phone (the columns are counted from
0 rather than 1, so Column(4) is actually the fifth column).
This is just a sketch of one approach. I will await more information from
you.
 
Back
Top