MHadden
Programmer
- May 13, 2001
- 105
Hello All:
I need to evaluate 2 fields to add a certain # of days to a date due field. The code I am using works very well, but I will have to do this for several scenarios & thought there may be someone out there with a shorter / more efficient way of doing this. The code is below & thanks in advance for any help!
- Michael
MichaelHadden@yahoo.com
If you give someone a fish, you have given them a meal. If you teach someone to fish, you have given them MANY meals!
I need to evaluate 2 fields to add a certain # of days to a date due field. The code I am using works very well, but I will have to do this for several scenarios & thought there may be someone out there with a shorter / more efficient way of doing this. The code is below & thanks in advance for any help!
- Michael
Code:
Private Sub Command23_Click()
If Insurance = "Medicare" And [Orders]!HCPC = "A7030" Then
[Orders]![Date_Due_Refill] = DateAdd("m", 3, [Orders]![Date_Last_Rec])
Else
If Insurance = "medicare" And [Orders]!HCPC = "A7031" Then
[Orders]![Date_Due_Refill] = DateAdd("m", 1, [Orders]![Date_Last_Rec])
Else
If Insurance = "medicare" And [Orders]!HCPC = "A7032" Then
[Orders]![Date_Due_Refill] = DateAdd("m", 1, [Orders]![Date_Last_Rec])
Else
If Insurance = "medicare" And [Orders]!HCPC = "A7033" Then
[Orders]![Date_Due_Refill] = DateAdd("m", 1, [Orders]![Date_Last_Rec])
Else
If Insurance = "medicare" And [Orders]!HCPC = "A7034" Then
[Orders]![Date_Due_Refill] = DateAdd("m", 3, [Orders]![Date_Last_Rec])
Else
If Insurance = "medicare" And [Orders]!HCPC = "A7035" Then
[Orders]![Date_Due_Refill] = DateAdd("m", 6, [Orders]![Date_Last_Rec])
Else
If Insurance = "medicare" And [Orders]!HCPC = "A7036" Then
[Orders]![Date_Due_Refill] = DateAdd("m", 6, [Orders]![Date_Last_Rec])
Else
If Insurance = "medicare" And [Orders]!HCPC = "A7037" Then
[Orders]![Date_Due_Refill] = DateAdd("m", 1, [Orders]![Date_Last_Rec])
Else
If Insurance = "medicare" And [Orders]!HCPC = "A7038" Then
[Orders]![Date_Due_Refill] = DateAdd("m", 1, [Orders]![Date_Last_Rec])
Else
If Insurance = "medicare" And [Orders]!HCPC = "A7039" Then
[Orders]![Date_Due_Refill] = DateAdd("m", 6, [Orders]![Date_Last_Rec])
Else
If Insurance = "medicare" And [Orders]!HCPC = "A7046" Then
[Orders]![Date_Due_Refill] = DateAdd("m", 6, [Orders]![Date_Last_Rec])
Else
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End Sub
MichaelHadden@yahoo.com
If you give someone a fish, you have given them a meal. If you teach someone to fish, you have given them MANY meals!