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!

Inhibit query if count >10

Status
Not open for further replies.

zapzip

Technical User
Jun 19, 2007
46
US
Hi- Need some ideas.
I have a form with two sub forms populated by queries. The user moves records from the first (by using Yes/No field) to the second. This is working fine but I would like to prevent more than 10 records in the 2nd form.

Any suggestions appreciate.

Change. Remember. Enjoy. Do it often. Dotcom
 
you need to keep a record of the number of items being transfered. Create an integer and increment it each time a record is transfer to the second table. But check if it is less than 10 before executing the query

something like
in the form open event

dim counter as integer
counter = 0

in the event you use to move the item

if counter < 10 then
run the query
else
msgbox "The maximum number of records have been added"
end if



Ian Mayor (UK)
Program Error
Always make your words sweet and nice. Because you never know when you may have to eat them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top