Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autofill a field based on criteria entered in previous records

Status
Not open for further replies.

LowBrow

Technical User
Jun 1, 2001
100
US
I have a table, tblTimeSheets, that has 14 fields including Date, ClientName, and DaysPaid. A single client may perform several different jobs in a day, but we would bill only for a single day. The problem is that we are working with over 40 clients and entering time per day. It is difficult to insure that when staff enter data for a client, that that do not enter multiple 'days' for a sinlge day of service.
I want to autofill the 'DaysPaid' field with the value of '1' the first time a record is entered for a particular client on a particular day, and then either enter '0' or be greyed out for any other entry for that client for that day.
It seems like a relatively simple issue, but I have thus far been unsuccessful.
I have tried to develop an If Then Else statement that runs a query on the table when 'DaysPaid' has focus, but I cannot seem to get the code correct. I have two problems: I cannot get the query to run at the time of focus and how to get the If Then Else statement to evaluate the records selected in the query. Is there a phrasing acceptable within the statement that will count the records called in the query?
I hope I have explained clearly enough. Any help would be much appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top