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

Updating Table automatically

Status
Not open for further replies.

OC2

IS-IT--Management
Apr 2, 2001
59
SG
Hi,

After creating an aging report, ive learnt that to update the whole table, I need to use an update query.
Could someone pls explain to me how I could use this query to do the following.

I have a text field that calculates the no. of days from transaction creation to transaction close. If this exceeds 1 day I need the query to recognise the "Open" in status field and change it to Overdue and colouring it red.

Current I have this working through VB code, but it will only update once i have clicked the record which in turn then updates it to the correct status.

I need this to update all records automatically so I can view the records in table format rather than in single form view.

Could anyone help me on this

thx
 
Create a query, make it an update query (query, update query from the menu) & include in your query:

1. A calculated field for you no. of days from transaction creation to transaction close. In the criteria for this field put >1

2. The status field. In the "Update To" row of this column, put "Overdue".

You could test the query at this point to make sure that appropriate records are update. Then, call this from an event on your form. (I'm not sure when you want the update to happen, but maybe AfterUpdate?)

Now, for formatting in red... Just add some code to the control to check for the "Overdue" & change the foreground color to red.

Hope this makes sense....



J. Jones
jjones@cybrtyme.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top