dwayne dibley
Registered User.
- Local time
- Today, 01:42
- Joined
- Oct 1, 2008
- Messages
- 26
A piece of code I have ceated refuses to work on a form on my computer only, which I thought was down to my lack of VB knoweldge.
A friend who works in programming has had a look at it and he can get the code working on his computer. But If he sends me the same file back(with the same code) it will not work on my PC.
I cant understand why this happening. I assume it must be down to my computer or the copy of access I am using.
This is the code
Private Sub returned_date_LostFocus()
Dim iDif As Integer
Dim result As Double
Dim idate1 As Date
Dim idate2 As Date
idate1 = [due_date]
idate2 = [returned_date]
iDif = DateDiff("d", [idate1], [idate2])
If iDif > 0 Then
result = iDif * 0.05
[ABC1].Value = result
End If
End Sub
I ran the code via the local windows the "result" variable outcome is correct but the text field {ABC1} will not populate the result.
Any ideas??
A friend who works in programming has had a look at it and he can get the code working on his computer. But If he sends me the same file back(with the same code) it will not work on my PC.
I cant understand why this happening. I assume it must be down to my computer or the copy of access I am using.
This is the code
Private Sub returned_date_LostFocus()
Dim iDif As Integer
Dim result As Double
Dim idate1 As Date
Dim idate2 As Date
idate1 = [due_date]
idate2 = [returned_date]
iDif = DateDiff("d", [idate1], [idate2])
If iDif > 0 Then
result = iDif * 0.05
[ABC1].Value = result
End If
End Sub
I ran the code via the local windows the "result" variable outcome is correct but the text field {ABC1} will not populate the result.
Any ideas??