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

Query result as validation??

Status
Not open for further replies.

Thijs

Technical User
Nov 24, 2000
31
NL
Hi all,

I've got the following question:

I have a query which calculates the sum of a field per user.

In the form where the query is used there is a button "new". When this button is pressed the query runs. When the result is >= 100 a msgbox has to come up with a message (of course) and else the user may add a new record.

So, how can I use the result of the query as validation in a form (button).

Thnx in advance,

Thijs Kromhout
The Netherlands.
 
hoi thijs,

je kan een ado- recordset creëren die de query uitvoert en met een integer het aantal rijen van deze recordset tellen. Indien dit aantal >= 100 dan kan je dit (als variabele) doorgeven en je msgbox tonen (of niet).
Indien dit nogal kryptisch lijkt, lees dan eens de help na (best in de vba-editor) betreffende ado-recordsets en vergeet zeker niet te checken of er een referentie naar de ado-bibliotheek werd gezet.

groeten,

Vincent
 
katho

Spreek asseblief engels.
Kan nie so goed Nederlands verstaan nie.

Bob
 
Katho (Vincent),

I made a mistake in writing my question.
The query makes a SUM of a row with money figures. The query does this per user.
e.g:
User01: SumTotal = 95euros
User02: SumTotal = 110euros
etc.

Query results are:
User_ID | Sum of vergoeding
User01 | 95

If the total sum exceeds 100 euro's than a messagebox should appear.

Hope this makes it any clearer.

Thnx in advance,

Thijs Kromhout
The Netherlands
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top