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

HELP with disabling ALLOW Addition!!!!

Status
Not open for further replies.

ShaneBrennan

Programmer
May 19, 1999
198
GB
I have this little problem.<br><br>I'm trying to limit the number of records that can be entered into a sub-form.<br><br>I have two variables:<br><br>MaxAllowed:&nbsp;&nbsp;The maximum number of boxed allowed to be placed in a filing cabinet.<br>NoOfBoxes:&nbsp;&nbsp;Who's control source counts up the number of records in the sub-form.<br><br>Both these variables work beautifully - not bad for access. <br><br>I also have a piece of code in the ON TIMER of the sub-form which checks these variables, compares them - then sets the ALLOW ADDITIONS&nbsp;&nbsp;event accordingly - this is run every 1/10th of a second.<br><br>This all works absoultely wonderfully however&nbsp;&nbsp;there is a small problem.&nbsp;&nbsp;Before the timer has chance to execute, speed typest can sneek in an extra record into the sub-form before the ALLOW ADDITIONS is set to false.<br><br>I've tried placing the code into a field on the sub-forms in the following events and they don;t seem to be able to solve the problem:<br><br>ON GET FOCUS<br>ON LOST FOCUS<br>ON CLICK<br>etc.<br><br>I know the code in the timer works - extensive testing has shown this.&nbsp;&nbsp;It's just the delay between entering the last record in the sub-form and ALLOW ADDITIONS being set to false.<br><br>Any sugestions?<br><br>I would be grateful for any help on this.<br><br> <p> Shane Brennan<br><a href=mailto:brennans@tcat.ac.uk>brennans@tcat.ac.uk</a><br><a href= > </a><br>
 
how about in the before update event??? there should be no reason to run the timer just check before you update.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top