Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Weird Problem

Status
Not open for further replies.

Xenocide

Programmer
Jan 20, 2005
76
CA
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?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top