PC Review


Reply
Thread Tools Rate Thread

Change values back to zero

 
 
=?Utf-8?B?RG9ubmE=?=
Guest
Posts: n/a
 
      2nd May 2006
In a form that is linked to both a query and tables, I need to change all the
values in a particular field back to 0 (zero) to start a new year's worth of
data.

is there a way to set this up with a macro or some other way, other than to
just scroll thru every record and type in the 0?

I can't seem to get it right.
 
Reply With Quote
 
 
 
 
=?Utf-8?B?T2ZlciBDb2hlbg==?=
Guest
Posts: n/a
 
      2nd May 2006
First Back up your data.

Create a button on the form that run two things
1. You can use an update query to update a field to a certain value

Docmd.RunSql "UPDATE TableName SET TableName.[FieldName] = 0"

That incase you want to update all the records, with no filter

2. After running the SQL you need to refresh the form.
Me.Requery

--
Good Luck
BS"D


"Donna" wrote:

> In a form that is linked to both a query and tables, I need to change all the
> values in a particular field back to 0 (zero) to start a new year's worth of
> data.
>
> is there a way to set this up with a macro or some other way, other than to
> just scroll thru every record and type in the 0?
>
> I can't seem to get it right.

 
Reply With Quote
 
=?Utf-8?B?SmltIEphY2tzb24=?=
Guest
Posts: n/a
 
      2nd May 2006
Have you tried something like this?

For Each cell In Range("J2:J200") ' Change this to suit your cell range(s)
If cell.Offset(0, 0) > "0" Then
cell.Offset(0, 0) = "0"

End If
Next cell

Jim

"Donna" wrote:

> In a form that is linked to both a query and tables, I need to change all the
> values in a particular field back to 0 (zero) to start a new year's worth of
> data.
>
> is there a way to set this up with a macro or some other way, other than to
> just scroll thru every record and type in the 0?
>
> I can't seem to get it right.

 
Reply With Quote
 
=?Utf-8?B?SmltIEphY2tzb24=?=
Guest
Posts: n/a
 
      2nd May 2006
Please ignore my reply. I had Excel on the brain at the time.

Jim

"Jim Jackson" wrote:

> Have you tried something like this?
>
> For Each cell In Range("J2:J200") ' Change this to suit your cell range(s)
> If cell.Offset(0, 0) > "0" Then
> cell.Offset(0, 0) = "0"
>
> End If
> Next cell
>
> Jim
>
> "Donna" wrote:
>
> > In a form that is linked to both a query and tables, I need to change all the
> > values in a particular field back to 0 (zero) to start a new year's worth of
> > data.
> >
> > is there a way to set this up with a macro or some other way, other than to
> > just scroll thru every record and type in the 0?
> >
> > I can't seem to get it right.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
lookup all values against all values only gives me one value back? efandango Microsoft Access Queries 1 14th Jan 2008 09:21 PM
change back colour with values from a table =?Utf-8?B?TW9oYW4=?= Microsoft Access Forms 0 8th Dec 2006 03:56 AM
Pulling data from values selected in dropdown list-values back to =?Utf-8?B?YmFicw==?= Microsoft Access Forms 1 26th Jan 2006 07:40 PM
How can I send back(Post back) some values from client machine Joby Microsoft ASP .NET 0 14th May 2004 05:19 AM
Column values are numbers not letters, how to change back Tim Stephens Microsoft Excel Misc 2 6th Jan 2004 12:53 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:15 AM.