A
AvidMedia
I am currently trying to find a way to assign an ID to a record depending on
whether or not it lies between certain dates. So for example if the record in
question was opened between 2 dates it would be given the ID 1, and if it
lied between 2 other dates it would be given the ID 2.
The code i have come up with is as follows:
If (Me.Open_date) < (Me.Meeting1) Then
ID=0
ElseIf (Me.Open_date) >= (Me.Meeting1) And (Me.Open_date) < (Me.Meeting2) Then
ID=1
ElseIf (Me.Open_date) >= (Me.Meeting2) And (Me.Open_date) < (Me.Meeting3) Then
ID=2
ElseIf (Me.Open_date) >= (Me.Meeting3) And (Me.Open_date) < (Me.Meeting4) Then
ID=3
Else
ID=4
End If
I have tried using this code in the Default Value of the ID control on both
a Form and the original table with no luck.
Does anyone have any ideas on how i could go about doing this?
The idea is that i can then group the records using this ID, as there seems
to be no way to group the records that lie between certain dates.
whether or not it lies between certain dates. So for example if the record in
question was opened between 2 dates it would be given the ID 1, and if it
lied between 2 other dates it would be given the ID 2.
The code i have come up with is as follows:
If (Me.Open_date) < (Me.Meeting1) Then
ID=0
ElseIf (Me.Open_date) >= (Me.Meeting1) And (Me.Open_date) < (Me.Meeting2) Then
ID=1
ElseIf (Me.Open_date) >= (Me.Meeting2) And (Me.Open_date) < (Me.Meeting3) Then
ID=2
ElseIf (Me.Open_date) >= (Me.Meeting3) And (Me.Open_date) < (Me.Meeting4) Then
ID=3
Else
ID=4
End If
I have tried using this code in the Default Value of the ID control on both
a Form and the original table with no luck.
Does anyone have any ideas on how i could go about doing this?
The idea is that i can then group the records using this ID, as there seems
to be no way to group the records that lie between certain dates.