Refreshing data

Matt Brown

Registered User.
Local time
Today, 07:41
Joined
Jun 5, 2000
Messages
120
I have a purchase order (purchasing dept)form which recieves orders from other purchase order input forms through a query.I am trying to get the form to refresh data or even flag up when a new purchase order is created and sent to it. Can this be done when the form is opened? and if so what would be the best way to do this?
 
Hello Matt,

In your query you need to add a field with a type of yes/no (boolean)with a default value of -1 (yes true). In the On Load procedure of the form you could use DCount to see if there are any records with a yes (new) value in this flag. If the DCount comes back as greater than 0 you know there are new records. Set the RecordSource of your form to the query (I'd use the SQL value of the query) with -1 in the criteria of the flag field. If the DCount comes back empty set the RecordSource to the query with 0 in the criteria.
You'll either add a button or use the On Close event to run a update query that sets the new field in all records to 0.

If you have problems with this send me an e-mail to Robin@falconer.mtx.net

Good Luck
Robin.
 

Users who are viewing this thread

Back
Top Bottom