Appending

  • Thread starter How do you clear a report of data after
  • Start date
H

How do you clear a report of data after

I would like to append one row at a time i.e. the view I have on my form is
the one I would like to append with appending the whole table plus I would
like to do this via a command button is this possible.

Thank you
George
 
A

Armen Stein

I would like to append one row at a time i.e. the view I have on my form is
the one I would like to append with appending the whole table plus I would
like to do this via a command button is this possible.

Hi George,

Your question doesn't seem clear to me. Can you try rewording it to
describe exactly what you want to do? Maybe with an example?

Armen Stein
Microsoft Access MVP
www.JStreetTech.com
 
H

How do you clear a report of data after

Hi Armen
Sorry if I seem abit unclear, What I would like to do is create a archive
table but instead of archiving all of the table I would like to archive just
the record I 'am viewing in the form view via a command button reason being
the record on view has tasks to compelete and when completed I would like to
archive that record.
Thank you for your time.
 
A

Armen Stein

Hi Armen
Sorry if I seem abit unclear, What I would like to do is create a archive
table but instead of archiving all of the table I would like to archive just
the record I 'am viewing in the form view via a command button reason being
the record on view has tasks to compelete and when completed I would like to
archive that record.
Thank you for your time.

Okay, that's clearer.

First, unless you have hundreds of thousands of records, there's no
need to archive to another table. Most developers would just set a
flag in the record to indicate that it's complete. Then you can have
your queries, forms and reports omit the completed records, unless you
want to see them in history. That's much easier and better-structured
than moving them to another table.

But if you really *must* archive them to another table, you can write
a bit of VBA behind your command button to run an Append query to your
archive table, specifying the primary key from the current record in
the criteria. Then you can delete the current record. This all
assumes you don't have any child records under this record.

Armen Stein
Microsoft Access MVP
www.JStreetTech.com
 
H

How do you clear a report of data after

I forgot to mention I'am new Access what do you mean by setting a flag in a
record and hwo would you do this
 
A

Armen Stein

I forgot to mention I'am new Access what do you mean by setting a flag in a
record and hwo would you do this

Well, either way is going to require a little coding, but if you're
interesting in learning more:

Add a field to your table design called something like CompleteFlag.
Set its default to False.

In your form, in the Before Update event, add some VBA in an Event
Procedure that checks for completeness and sets that flag to True.
Something like (air code):

If Me.MyCheckbox1 = True And Me.MyCheckbox2 = True then
' this record is complete
Me.CompleteFlag = True
End If

Then, change any queries or reports that you would like to ignore the
Completed records. You would add a Where clause, like this:

"Select * from MyTable Where CompleteFlag = False"

This query will return only those records that are not yet "complete".

Hope this gets you started at least. I encourage you to search the
Help files and online newsgroups when you have question about specific
techniques.

Armen Stein
Microsoft Access MVP
www.JStreetTech.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top