View Full Version : Criteria checker


mark curtis
01-29-2002, 04:09 AM
Dear all,
I need to run a routine that checks two criteria based on a parameter value.

eg

I want a user to insert their social security number then I want to click a button that checks if the user has firstly used their limit(a field that stores a value) then secondly checks if they have a bad credit record(field that stores credit rating) then to finsh returns a message to say proceed or stop because they fail the above criteria.

Any examples would be great.

Thanks
Mark

doulostheou
02-08-2002, 03:08 PM
I might be making your question too simplistic. I am assuming the social security number is already tied to their limit and credit rating. Create a form based off of a query that linked the two tables together (joining the two by the social). You would have 4 fields on the form, one unbound (name it FindSocial), one for the social, one for the limit, one for the rating. You would type the social in the unbound field and then onclick of the button the code would run:

Social.setfocus
docmd.FindRecord FindSocial
If limit<(max amount) And rating>(good rating) Then
msgbox "Proceed"
Else
msgbox "Stop"
End if

If the max amount and good rating varies from person to person, you may have to incorporate another query that evaluates whether it is good or bad and returns a value accordingly.