If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
use query result to display a message
I use a Access Time Clock to tract employes hours. An employee enters his
EmId and clicks a command button to SignIn. The computer enters the date & time. He does the same to SingOut. Sometimes someone forgets to SignOut. How do I restrict the next SignIn before correcting the forgotten SignOut. thanks JJF |
#2
|
|||
|
|||
use query result to display a message
Hi,
The latest operation, for a given employee, could not be of the same type (ie, cannot be a sign in if you try a sign in). Since that implies a cross-record validation (vertically). A standard table validation rule only work horizontally, on one record, not across records. Jet-CHECK() constraint allows vertical, across records, validations, as a rule, but MS SQL Server would use trigger (since its CHECK constraint does not allow vertical, across records, validations). If you are in a FORM, that is easier, look at the records, for the given employee, and it is ok to sign in if: DCount("*", "tableName", "employee=1100 AND SignInOut=-1) = DCount("*", "tableName", "employee=1100 AND SignInOut=0") ie, if the number of sign in = the number of sign out, for that employee. The problem with table validation carried only at a form level is that entry of data through another form, or another interface, may not do the appropriate check and thus, data is in a less secure state than if the validation is carried at a table design level. Hoping it may help, Vanderghast, Access MVP "JJF" wrote in message ... I use a Access Time Clock to tract employes hours. An employee enters his EmId and clicks a command button to SignIn. The computer enters the date & time. He does the same to SingOut. Sometimes someone forgets to SignOut. How do I restrict the next SignIn before correcting the forgotten SignOut. thanks JJF |
#3
|
|||
|
|||
use query result to display a message
Thanks Mike I'll see where it leads ...JJF
"Michel Walsh" wrote: Hi, The latest operation, for a given employee, could not be of the same type (ie, cannot be a sign in if you try a sign in). Since that implies a cross-record validation (vertically). A standard table validation rule only work horizontally, on one record, not across records. Jet-CHECK() constraint allows vertical, across records, validations, as a rule, but MS SQL Server would use trigger (since its CHECK constraint does not allow vertical, across records, validations). If you are in a FORM, that is easier, look at the records, for the given employee, and it is ok to sign in if: DCount("*", "tableName", "employee=1100 AND SignInOut=-1) = DCount("*", "tableName", "employee=1100 AND SignInOut=0") ie, if the number of sign in = the number of sign out, for that employee. The problem with table validation carried only at a form level is that entry of data through another form, or another interface, may not do the appropriate check and thus, data is in a less secure state than if the validation is carried at a table design level. Hoping it may help, Vanderghast, Access MVP "JJF" wrote in message ... I use a Access Time Clock to tract employes hours. An employee enters his EmId and clicks a command button to SignIn. The computer enters the date & time. He does the same to SingOut. Sometimes someone forgets to SignOut. How do I restrict the next SignIn before correcting the forgotten SignOut. thanks JJF |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Display query result in a Control on a Form | curniac | Running & Setting Up Queries | 1 | July 19th, 2006 05:46 PM |
Calculate a percentage using 2 different query totals | jbeck2010 | Database Design | 18 | March 1st, 2005 12:51 AM |
Big number gives error! | Sara Mellen | Running & Setting Up Queries | 8 | October 11th, 2004 02:48 AM |
Display Parameter from Form on Report | sara | Setting Up & Running Reports | 10 | July 19th, 2004 04:54 PM |
Display a query result in form | Le Tran | New Users | 0 | June 15th, 2004 09:08 PM |