I am trying to get the following code eto look for a account number and if it is found update the value. I can get that to work but if the account is not found I want to force an account number and I cannot seem to get it to work. Any help would be appreciated.
Tony
intValue = DLookup("KY_BA", "OLDACCOUNTS", "[OLDACCOUNTS].[OldAcct]=" & rs![ky_ba])
if Not IsNull(intValue) Then
strsql = "UPDATE [TABLE_ONE] SET [TABLE_ONE].KY_BA = " & intValue
strsql = " UPDATE [TABLE_ONE]Set [TABLE_ONE].[KY_BA] = 4999999999"
DoCmd.RunSQL strsql
Tony
intValue = DLookup("KY_BA", "OLDACCOUNTS", "[OLDACCOUNTS].[OldAcct]=" & rs![ky_ba])
if Not IsNull(intValue) Then
strsql = "UPDATE [TABLE_ONE] SET [TABLE_ONE].KY_BA = " & intValue
strsql = " UPDATE [TABLE_ONE]Set [TABLE_ONE].[KY_BA] = 4999999999"
DoCmd.RunSQL strsql