PDA

View Full Version : Solved: Alert message based on a value



TalonTC
06-08-2009, 07:12 AM
Hello Professionals!
I'm trying to create a low balance alert that will fire when an Access form is first opened. The alert needs to be raised for all records that meet the low balance criteria (all records are located in a single table). I'm thinking that it would be easiest to have a seperate form pop open that lists all of the customers with low balances but I can't seem to get the code right to do it. I'm running Access 2003, but can also use 2007 if it would make things easier.
Any suggestions would be much appreciated.
Thank you
Dan Tuma (TalonTC)

CreganTur
06-08-2009, 07:45 AM
What constitutes a low balance? What is the name of the field in your table that holds balance amounts?

TalonTC
06-08-2009, 07:55 AM
What constitutes a low balance? What is the name of the field in your table that holds balance amounts?
Hi CreganTur,
A low balance would be either a hard coded dollar amount such as $100.00 or now that I am thinking on it, a variable taken from an administration table. For this scenerio I think a hard coded amount will be sufficient. The field name is simply "Balance".
Thank you for your reply.

CreganTur
06-08-2009, 09:52 AM
Create a query in Access that pulls in all the fields you want from your table. For your Balance field, enter in the criteria: < 100.00. Then create a new form and make this query it's data source. Design the form so it looks the way you want it to, and then set it in Continuous Form mode.

Then you can use code like this to launch it from your main form:
If DCount("FieldName","QueryName") > 0 Then
DoCmd.OpenForm "FormName"
End If
Replace FieldName with the primary key field in the new query you just created, and change QueryName ot the name of the query. Change FormName to the name of the new continuous form you created. This will open the form for viewing whenever there are accounts in your query.

HTH:thumb

TalonTC
06-09-2009, 05:26 AM
CreganTur,
Perfect! Exactly what I was looking for. Thank you for your help.
Dan Tuma