Data Entry Form

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

Guest

Hi. Right now I am working with two tables. One has Employee IDs and Employee
Names. The other has Employee IDs, Annual Salaries, and the Year. There will
already be information in both. I would like the form to look like this:

Year: (Textbox)
Employee: (Textbox with Employee ID and Last Name)
Annual Salary: (Textbox)

Here are my questions...

A) How can I get it so my user is somehow asked (possibly a dialog box) what
year they would like to enter and have it enter into all the year fields?
B) And, show the information for the previous year, but enter the current
year? (Show information from 2005, but enter it as 2006)

Any and all help will be greatly appreciated!

Thank you,
Tandy
 
Hi, Tandy.

Since there is a natural one-to-many relationship between Employees and
Salaries, the best implementation is a main form based on Employee ID & a
subform based on Salaries, linked by the EmployeeID.

To show only the previous year's salaries rather than the entire historical
record, base the subform on a query of the Salaries table, with the criteria:
=Year(Now()) - 1

The simplest way to assist the data entry is to change the Default Value
property of the Year field in its AfterUpdate event procedure--no prompt
required. Once the first new record is added, all new ones will default to
the current year. Be sure not to name the field "Year", however, which is an
Access reserved word.

' SalaryYear AfterUpdate event
Me!YourYearFieldControl.DefaultValue = Me!YourYearFieldControl

Hope that helps.
Sprinks
 
Back
Top