Junkee Brewster
Registered User.
- Local time
- Today, 20:08
- Joined
- May 21, 2005
- Messages
- 33
Hi There,
My form is set up to show all current records, and allow users to select a button and then view "archived" records (I archive by having a Yes/No box). I'll show you:
Secondly, I've got a setup that will: flag expired dates by changing the background colour of the field, and also showing "Nag Messages" in a message box when the date is expired OR the date expires in the next 2 weeks. Example:
How do I prevent the Nag messages and the changing the background of records that are ARCHIVED?
My visual basic is only basic, and I've built upon some existing code and I'm lucky to have worked out this far hehe. I can KIND of see what I have to do, but I just can't get it right. Any help would be greatly appreciated.
My form is set up to show all current records, and allow users to select a button and then view "archived" records (I archive by having a Yes/No box). I'll show you:
Code:
Private Sub cmdShowArchived_Click()
If cmdShowArchived.Caption = "Show Archived" Then
Me.RecordSource = "SELECT QryVehicles.* FROM QryVehicles
WHERE (((QryVehicles.Archived)=Yes));"
DoCmd.Requery
DoCmd.GoToRecord , , acFirst
cmdShowArchived.Caption = "Show Current"
Me.AllowAdditions = False
Me.AllowDeletions = False
Me.Archived.Visible = True
Me.archivedBox.Visible = True
Else
Me.RecordSource = "SELECT QryVehicles.* FROM QryVehicles
WHERE (((QryVehicles.Archived)=No));"
DoCmd.Requery
DoCmd.GoToRecord , , acFirst
cmdShowArchived.Caption = "Show Archived"
Me.AllowAdditions = True
Me.AllowDeletions = True
Me.Archived.Visible = True
Me.archivedBox.Visible = True
End If
End Sub
Code:
If Not IsNull(txt90DayService) And _
Not IsEmpty(txt90DayService) Then
If ((CDate(txt90DayService) < Date)) Then
MsgBox "Reminder: 90 Day Service for vehicle is Overdue", vbInformation
ElseIf ((CDate(txtReTest) - Date) < 14) Then
MsgBox "Reminder: 90 Day Service for vehicle is due within two
weeks", vbInformation
End If
End If
If (Not IsNull(Me.txt90DayService)) Then
If fncPersonnelExpiredLicenses(Me.txt90DayService) Then
Me.txt90DayService.BackColor = vbRed
Else
Me.txt90DayService.BackColor = vbWhite
End If
Else
Me.txt90DayService.BackColor = vbWhite
End If
My visual basic is only basic, and I've built upon some existing code and I'm lucky to have worked out this far hehe. I can KIND of see what I have to do, but I just can't get it right. Any help would be greatly appreciated.