Form

G

Guest

Hey guys,

I have a form where I key info every day. When i enter ID of an employee,
column NAME shows his name automatically. I want to include one more column
HIRE DATE. How do i make the form to show the hire date automatically too,
like it does with NAME?

Your help will be highly appreciated.
Thanks.
 
G

Guest

Hi, Alish.

Double-click on the left square at the top left of the window to display the
Form properties. In the RecordSource property should be the name of the
form's underlying query. Click on the ellipsis to the right of the field to
edit the query. Add the HireDate field from the Employee table to the query,
save it, and then place a new textbox control on the form bound to that field.

Hope that helps.
Sprinks
 
S

Sandra Daigle

I'm guessing that you are using what is known as an autolookup query where
the table on the One side of a One to Many relationship is joined with the
table on the Many side of the relationship. Then as long as the join field
is added to the query from the Many table, when data is added to the join
field, the related fields from the One side are populated for you.
Take a look at the underlying query. Is the NAME field coming from one table
while everything else is coming from a different table (I have no idea what
kind of data you're entering on this form)? If so, just add the Hire Date
field to the query by dragging it from the Employee table. Then save the
query and then drag the field onto your form.

The other way this is commonly done is to use a combo box for looking up the
EmployeeID - by including other related fields in the combo boxes rowsource
query, you can easily add textboxes which use an expression to get their
values from the combo box using the Column Property.

One other thing - you should avoid having a field named *NAME*. *NAME* is
used extensively as a builtin property of most objects and this can lead to
runtime issues and anomalies when it is unclear what *NAME* is being
referenced. Generally speaking, it is better to use a prefix or suffix to
describe what kind of name it is, ie FirstName or LastName. Same thing goes
with Dates and other common keywords.
 
G

Guest

Sandra, I checked and all info, including NAME is coming from the same table
(tblTickets). I use the form to enter employees ticket info like ticket
number, price and etc.

Thanks.

Sandra Daigle said:
I'm guessing that you are using what is known as an autolookup query where
the table on the One side of a One to Many relationship is joined with the
table on the Many side of the relationship. Then as long as the join field
is added to the query from the Many table, when data is added to the join
field, the related fields from the One side are populated for you.
Take a look at the underlying query. Is the NAME field coming from one table
while everything else is coming from a different table (I have no idea what
kind of data you're entering on this form)? If so, just add the Hire Date
field to the query by dragging it from the Employee table. Then save the
query and then drag the field onto your form.

The other way this is commonly done is to use a combo box for looking up the
EmployeeID - by including other related fields in the combo boxes rowsource
query, you can easily add textboxes which use an expression to get their
values from the combo box using the Column Property.

One other thing - you should avoid having a field named *NAME*. *NAME* is
used extensively as a builtin property of most objects and this can lead to
runtime issues and anomalies when it is unclear what *NAME* is being
referenced. Generally speaking, it is better to use a prefix or suffix to
describe what kind of name it is, ie FirstName or LastName. Same thing goes
with Dates and other common keywords.

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

Hey guys,

I have a form where I key info every day. When i enter ID of an
employee, column NAME shows his name automatically. I want to include
one more column HIRE DATE. How do i make the form to show the hire
date automatically too, like it does with NAME?

Your help will be highly appreciated.
Thanks.
 
S

Sandra Daigle

Were you able to get it working correctly by pulling the HireDate field from
the same table?

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

Sandra, I checked and all info, including NAME is coming from the
same table (tblTickets). I use the form to enter employees ticket
info like ticket number, price and etc.

Thanks.

Sandra Daigle said:
I'm guessing that you are using what is known as an autolookup query
where the table on the One side of a One to Many relationship is
joined with the table on the Many side of the relationship. Then as
long as the join field is added to the query from the Many table,
when data is added to the join field, the related fields from the
One side are populated for you.
Take a look at the underlying query. Is the NAME field coming from
one table while everything else is coming from a different table (I
have no idea what kind of data you're entering on this form)? If so,
just add the Hire Date field to the query by dragging it from the
Employee table. Then save the query and then drag the field onto
your form.

The other way this is commonly done is to use a combo box for
looking up the EmployeeID - by including other related fields in the
combo boxes rowsource query, you can easily add textboxes which use
an expression to get their values from the combo box using the
Column Property.

One other thing - you should avoid having a field named *NAME*.
*NAME* is used extensively as a builtin property of most objects and
this can lead to runtime issues and anomalies when it is unclear
what *NAME* is being referenced. Generally speaking, it is better to
use a prefix or suffix to describe what kind of name it is, ie
FirstName or LastName. Same thing goes with Dates and other common
keywords.

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

Hey guys,

I have a form where I key info every day. When i enter ID of an
employee, column NAME shows his name automatically. I want to
include one more column HIRE DATE. How do i make the form to show
the hire date automatically too, like it does with NAME?

Your help will be highly appreciated.
Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top