Hi
I just got a really weird problem and I really don't know what is going on
Here's the code that cause the problem
Private Sub lst1_AfterUpdate()
Dim Total1, Total2 As Long
If IsNull(DLookup("IdEngagementA", "Table850", "Maitre='" & lst1.Value & "' AND IdEngagementA <> '" & lst1.Value & "' "))
Then
txt4.Value = DLookup("MontantActuel", "Table850", "IdEngagementA='" & lst1.Value & "' ")
Else
Total1 = DLookup("MontantActuel", "Table850", "IdEngagementA='" & lst1.Value & "' ")
Total2 = DLookup("Sum(MontantActuel)", "Table850", "Maitre='" & lst1.Value & "' AND IdEngagementA <> '" & lst1.Value & "' ")
Total2 = Total2 - Total1
txt4.Value = Total1 - Total2
End If
End Sub
Ok here's the problem... txt4 ain'T showing anything in the first part of the if. Maybe that could be a problem because of my Dlookup.
No it's not since I have exactly the same part in the second part of the if and it work perfectly.
Does somebody know what's the problem?
I just got a really weird problem and I really don't know what is going on
Here's the code that cause the problem
Private Sub lst1_AfterUpdate()
Dim Total1, Total2 As Long
If IsNull(DLookup("IdEngagementA", "Table850", "Maitre='" & lst1.Value & "' AND IdEngagementA <> '" & lst1.Value & "' "))
Then
txt4.Value = DLookup("MontantActuel", "Table850", "IdEngagementA='" & lst1.Value & "' ")
Else
Total1 = DLookup("MontantActuel", "Table850", "IdEngagementA='" & lst1.Value & "' ")
Total2 = DLookup("Sum(MontantActuel)", "Table850", "Maitre='" & lst1.Value & "' AND IdEngagementA <> '" & lst1.Value & "' ")
Total2 = Total2 - Total1
txt4.Value = Total1 - Total2
End If
End Sub
Ok here's the problem... txt4 ain'T showing anything in the first part of the if. Maybe that could be a problem because of my Dlookup.
No it's not since I have exactly the same part in the second part of the if and it work perfectly.
Does somebody know what's the problem?