i'm trying to run an update query using VB and using DLookup as the value to update to
here's my code
what am i doing wrong? i tried tying it to a button just to see if it works, and it doesn't
i have a table CL_TOTAL with 2 fields, group and sumofclaims
i need to update field TOTALCLAIMS in table CLAetna to the value from SUMOFCLAIMS in CL_TOTAL where GROUP=AETNA
so simple, why doesn't this work?
thank you
here's my code
Code:
Dim SQL As String
Dim varX As Variant
varX = DLookup("[sumofclaims]", "cl_total", "[group]=aetna")
SQL = "UPDATE CLAetna Set CLAetna.TotalClaims = varx"
DoCmd.RunSQL SQL
what am i doing wrong? i tried tying it to a button just to see if it works, and it doesn't
i have a table CL_TOTAL with 2 fields, group and sumofclaims
i need to update field TOTALCLAIMS in table CLAetna to the value from SUMOFCLAIMS in CL_TOTAL where GROUP=AETNA
so simple, why doesn't this work?
thank you