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

Update a text field (number) incrementally

Status
Not open for further replies.

Lhuffst

Programmer
Jun 23, 2003
503
US
on a query, if you have a text field (imported so it will always be text) and you need to update it incrementally by one
how would you do the query?

I tried
Field: PermitNo
Table: My_ImportSpec
Update: CStr([My_ImportSpec]![PermitNo]+1)

I have 200+ rows to increment. I entered the next number is row 1 but want to automate the rest instead of having to type them in individually.

When I run the above, it says I can't update the rows because of a conversion error.
Thanks
Lhuffst
 
Are you suggesting the records have already been imported? Do your records have a field or fields that can be used to determine the numbering?

Apparently PermitNo is text which would need to be converted to numeric in order to +1.

Duane
Hook'D on Access
MS Access MVP
 
How about simply:
[tt]Update My_ImportSpec
Set PermitNo = PermitNo + 1[/tt]

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top