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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DMAX function?

Status
Not open for further replies.

John1Chr

Technical User
Sep 24, 2005
218
0
0
US
I think this might be simple to solve.

I have a dbase in which I am trying to append tbl2 to tbl1 and at the same time setting all of tbl1 type fields that are null to D. The assigning D is ok but the problem lies in trying to append based on the CheckNo.

tbl1 has check numbers that go from 1 all the way to 10015. I only want to append the new check numbers, ie 10016 and above. The problem is that we changed the check number field from text to number and now the last line bombs. How can I make it work if so that it reads numbers.

Here's the code:

DoCmd.RunSQL "Update [tbl DDRetAccum]" & _
"Set Type = ""D"" " & _
" "Where Type is null and CheckNo > ""0000"" " - this line bombs, it wants a number.
 
Code:
DoCmd.RunSQL "UPDATE [tbl DDRetAccum] SET Type='D'" & _
   " WHERE Type IS NULL AND CheckNo>0000"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
worked great...couldn't remember how to do...thanks PHV.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top