B
BruceM
I am working on modifications to an inefficiently designed Approved Vendor
database. The vendors have certificates have expiration dates. Some
vendors have more than one certificate, so I have created a new table for
certificates, on the many side of a one-to-many relationship with the main
vendor table. With some help from this group I moved certificate
information from the main table to the related table. The form/subform
based on the related tables works as it should.
Here is the basic structure:
tblVendor
VendorID (PK)
VendorName
Other vendor information
tblCert
CertID (PK)
VendorID (FK)
CertType (text)
CertExp (Date/Time)
CertRequested (Yes/No)
CertReturned (Yes/No)
As a vendor's certificate expiration date approaches I need to send a
request for new information. In the current version of the database I have
three command buttons on an unbound form: one button to check for
certificates that are about to expire or have just expired (I do this about
once a month, and check the CertRequested box on the subform to show it was
requested), another to send a second reminder if CertRequested is True and
the expiration date has passed, and a third button for certificates that are
seriously overdue.
The request is a report (rptFaxCert) that is intended as a fax. It is
grouped on VendorName, with Force New Page set to Before Section. It is
based on a query (inner join) that includes both tables.
I placed this in the Click event of a comman botton on the unbound form:
Dim strCertSQL As String
strCertSQL = "[CertReturned] = True AND [CertExp] BETWEEN
DateAdd(""ww"",-2,Date()) AND DateAdd(""m"",1,Date())"
DoCmd.OpenReport "rptFaxCert", acPreview, , strCertSQL
This shows vendors with certificate expiration dates between two weeks ago
and a month into the future.
There are two points here. First, I need to add text for the fax body,
along the lines of:
Dim strFaxBody as String
strFaxBody = "Your " & [CertType] " is going to expire on " & [CertExp]
& ". Please send an updated certificate."
I can't get my brain around how best to do this. If I am to use the
strFaxBody code, would it be in the report's Print event, or what? Or is
there a better way to do this, such as a concatenated query field?
Second point: Does it make sense to use one command button to check for the
three categories: expiration date approaching or just past; late; and very
late? I would like to click one CheckCert command button (on the unbound
form), and to generate a separate fax with appropriate text for each
situation. When the report opens, Vendor1, whose cert is about to expire,
would get a fax that says "Your cert is about to expire". Vendor2, from
whom I have already requested a fax, and whose cert expired more than two
weeks ago, would get a fax that says "You're late", and so forth. Running
the report would produce all categories at once, without the need for three
separate command buttons on the unbound form.
I am not committed to any line here. I am trying to show that I have been
working on this, and am stuck. Any suggestions, including that I approach
this differently from the earliest step, are welcome.
database. The vendors have certificates have expiration dates. Some
vendors have more than one certificate, so I have created a new table for
certificates, on the many side of a one-to-many relationship with the main
vendor table. With some help from this group I moved certificate
information from the main table to the related table. The form/subform
based on the related tables works as it should.
Here is the basic structure:
tblVendor
VendorID (PK)
VendorName
Other vendor information
tblCert
CertID (PK)
VendorID (FK)
CertType (text)
CertExp (Date/Time)
CertRequested (Yes/No)
CertReturned (Yes/No)
As a vendor's certificate expiration date approaches I need to send a
request for new information. In the current version of the database I have
three command buttons on an unbound form: one button to check for
certificates that are about to expire or have just expired (I do this about
once a month, and check the CertRequested box on the subform to show it was
requested), another to send a second reminder if CertRequested is True and
the expiration date has passed, and a third button for certificates that are
seriously overdue.
The request is a report (rptFaxCert) that is intended as a fax. It is
grouped on VendorName, with Force New Page set to Before Section. It is
based on a query (inner join) that includes both tables.
I placed this in the Click event of a comman botton on the unbound form:
Dim strCertSQL As String
strCertSQL = "[CertReturned] = True AND [CertExp] BETWEEN
DateAdd(""ww"",-2,Date()) AND DateAdd(""m"",1,Date())"
DoCmd.OpenReport "rptFaxCert", acPreview, , strCertSQL
This shows vendors with certificate expiration dates between two weeks ago
and a month into the future.
There are two points here. First, I need to add text for the fax body,
along the lines of:
Dim strFaxBody as String
strFaxBody = "Your " & [CertType] " is going to expire on " & [CertExp]
& ". Please send an updated certificate."
I can't get my brain around how best to do this. If I am to use the
strFaxBody code, would it be in the report's Print event, or what? Or is
there a better way to do this, such as a concatenated query field?
Second point: Does it make sense to use one command button to check for the
three categories: expiration date approaching or just past; late; and very
late? I would like to click one CheckCert command button (on the unbound
form), and to generate a separate fax with appropriate text for each
situation. When the report opens, Vendor1, whose cert is about to expire,
would get a fax that says "Your cert is about to expire". Vendor2, from
whom I have already requested a fax, and whose cert expired more than two
weeks ago, would get a fax that says "You're late", and so forth. Running
the report would produce all categories at once, without the need for three
separate command buttons on the unbound form.
I am not committed to any line here. I am trying to show that I have been
working on this, and am stuck. Any suggestions, including that I approach
this differently from the earliest step, are welcome.