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!

Replacing a field contents 1

Status
Not open for further replies.

kkarren

Technical User
Mar 30, 2000
33
US
How do I replace the contents of an entire field from 0 to 1 in the events procedures? [sig][/sig]
 
kkarren Its difficult to figure out exactly what you want to do, if you could provide addtional information, we might be able to assist you.

PaulF [sig][/sig]
 
I have a text file that I import. There is a blank field in the import that sets to 0 each time I do the import. After the import is completed I want to change the 0 to 1 in all records in the table. What syntax can I use to change all of the records to 1. Thanks for your help. [sig][/sig]
 
Something like this should work, just call from your
macro. replace IMPORT with your table name and Myfield
with the field name


Dim Myrs As Recordset

Set db = CurrentDb
Set Myrs = db.OpenRecordset("select * from IMPORT")
Myrs.MoveFirst

Do While Not Myrs.EOF
Myrs.Edit
Myrs!Myfield = 1

Loop [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top