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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking Totals on a Form

Status
Not open for further replies.

Ianlog

Technical User
Nov 6, 2003
10
0
0
GB
I have written a database (Access97) for booking Employees Holidays within our company. On the Booking form I have displayed the number of days booked via a simple unbound control - Sum([Amount]). How can I check/restrict the bookings so that the maximum bookings cannot exceed the allowance?
I realise it's probably an easy and obvious answer - but I'm not well enough versed in Vb to write the code!!!
Is the form even the best/correct place to do this?

Thanks in anticipation!

Ian
 
Assuming that the 'allowed' is in a field as are 'incidents' where incidents are day(s) of vacation.

strSQL = "[VacTable]![EmpID] = " & me.EmpID & '"'

If DSUM("incidents", "VacTable", strSQL) > me.allowed then

MSGBOX "Oh, No you don't !!!!!"

endif

rollie@bwsys.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top