Dates in SQL

  • Thread starter Thread starter Lori2836 via AccessMonster.com
  • Start date Start date
L

Lori2836 via AccessMonster.com

Hopefully someone can help, as I'm sure this is pretty easy for those that
know what they are doing! I want to know how to change

if UC1.Value = CDbl(Text496.text) * 94.45/1000

to include

"if Initiated Date is before 4/1/07, else use 99.55/1000". Can
someone help?



Private Sub Text496_Change()

If IsNumeric(Text496.Text) Then
UC1.Value = CDbl(Text496.Text) * 94.45 / 1000
End If

End Sub
 
Lori2836 said:
Hopefully someone can help, as I'm sure this is pretty easy for those that
know what they are doing! I want to know how to change

if UC1.Value = CDbl(Text496.text) * 94.45/1000

to include

"if Initiated Date is before 4/1/07, else use 99.55/1000". Can
someone help?



Private Sub Text496_Change()

If IsNumeric(Text496.Text) Then
UC1.Value = CDbl(Text496.Text) * 94.45 / 1000
End If

End Sub


1) Do not use the Change event for this kind of thing.

2) Do no use the .Text property for this kind of thing.

3) Use the AfterUpdate event with something more like:

If IsNumeric(Text496) Then
If [Initiated Date] < #4/1/07# Then
UC1 = CDbl(Text496) * 94.45 / 1000
Else
UC1 = CDbl(Text496) * 99.55 / 1000
End If
End If
 
Back
Top