Hello, i need help please, i need to create an trigger in ms access 2007, probably by vb code, but don't know how. The issue: i created a database in ms access 2007 and i need to make an time trigger to show every time when opening the database (it opens and shows first switchboard) a 6 weeks ahead (trigger) of expiring time of different data entries in the "permit expire" fields of one of my created tables or reports. If possible flashing dates or anything similar. I was checking thru 3 different tutorials for ms access 2007 but can't find an solution. What are my options? And how can i go about it?

Have you got a query and possibly a form that show the data you wish to display ?

If so then open that instead of switchboard on startup.

Denis

Have you got a query and possibly a form that show the data you wish to display ?

If so then open that instead of switchboard on startup.

Denis

Thanks Denis, but the database should work like an application so i would need to have then at least still the dates which appear as to expire in 6 weeks in the fields, to then flash as for a warning or similar. How do I do that?

Try the following -

Dim myDate As Date, ExpiryDate As Date

rsDates.Open "SELECT TheDate FROM MyTableDates", cnDate, adOpenStatic, adLockOptimistic

MyDate = rsDates!TheDate
ExpiryDate = Now

If MyDate < ExpiryDate Then
   'Whatever to happen here
      Else
   'Flash code here
End If

You can refine this much more by using the DateDiff Function of which you can search using google and the term "DateDiff Function in VB6". This will return plenty of code samples to use.

This article has been dead for over six months. Start a new discussion instead.