R
Ruben
Hi,
I have a form that provides a listing of various instruments that are
serviced on a monthly to annual basis, with general info about the
instrument, last and next service dates, etc.. What I am trying to
do
is create an On Open event procedure that will identify all
instruments that are listed with a string of either "Past Due" or
"Schedule Vendor" based on whether each of their respective 'Due'
dates have already transpired or not from the current month.
The code I initially created for this was as follows:
Private Sub Form_Open()
Dim myDate, myDue
myDate = DateSerial(Year(me.ListDate), Month(Me.ListDate), 1)
myDue = Me.NextServiceDate
If Me.Due < mydate then
Me.Status="Past Due"
Elseif Me.Due >= mydate then
Me.Status="Schedule Vendor"
End if
End Sub
This of course only updates the first 'Status' field on the list but
not the rest. I know I probably need to code this under a Do...Loop
or For Each...Next statement, but I simply cannot figure out the
right way to do this.
Any help would really be appreciated.
Regards,
Ruben
I have a form that provides a listing of various instruments that are
serviced on a monthly to annual basis, with general info about the
instrument, last and next service dates, etc.. What I am trying to
do
is create an On Open event procedure that will identify all
instruments that are listed with a string of either "Past Due" or
"Schedule Vendor" based on whether each of their respective 'Due'
dates have already transpired or not from the current month.
The code I initially created for this was as follows:
Private Sub Form_Open()
Dim myDate, myDue
myDate = DateSerial(Year(me.ListDate), Month(Me.ListDate), 1)
myDue = Me.NextServiceDate
If Me.Due < mydate then
Me.Status="Past Due"
Elseif Me.Due >= mydate then
Me.Status="Schedule Vendor"
End if
End Sub
This of course only updates the first 'Status' field on the list but
not the rest. I know I probably need to code this under a Do...Loop
or For Each...Next statement, but I simply cannot figure out the
right way to do this.
Any help would really be appreciated.
Regards,
Ruben