By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,476 Members | 1,529 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,476 IT Pros & Developers. It's quick & easy.

Checkbox Issue

P: n/a
I have created an inventory database in Microsoft Access 2003. In my
assets form, I have a checkbox for cannibalized computers. I would
like to be able to put a check in that checkbox and have that
particular record moved to a new table. Is this possible? If it is
possible, can someone please tell me what I need to do to get this to
work? Thank you.

Jul 10 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
AP
Hello

Build an append query that references the current record on the form
and appends the record to the other table ( I will assume that it has a
similar layout)

On the afterupdate event of the checkbox run something like. Depending
on where the check box is in the data entry process you may need to add
a save command in there too. Test first by manually running the query
to see if it works as you expect.

Docmd.setwarnings false
docmd.openquery "your query here"
docmd.setwarnings true
AP
sa****@hotmail.com wrote:
I have created an inventory database in Microsoft Access 2003. In my
assets form, I have a checkbox for cannibalized computers. I would
like to be able to put a check in that checkbox and have that
particular record moved to a new table. Is this possible? If it is
possible, can someone please tell me what I need to do to get this to
work? Thank you.
Jul 10 '06 #2

P: n/a

AP wrote:
Hello

Build an append query that references the current record on the form
and appends the record to the other table ( I will assume that it has a
similar layout)

On the afterupdate event of the checkbox run something like. Depending
on where the check box is in the data entry process you may need to add
a save command in there too. Test first by manually running the query
to see if it works as you expect.

Docmd.setwarnings false
docmd.openquery "your query here"
docmd.setwarnings true
AP
sa****@hotmail.com wrote:
I have created an inventory database in Microsoft Access 2003. In my
assets form, I have a checkbox for cannibalized computers. I would
like to be able to put a check in that checkbox and have that
particular record moved to a new table. Is this possible? If it is
possible, can someone please tell me what I need to do to get this to
work? Thank you.
Jul 11 '06 #3

P: n/a
sa****@hotmail.com wrote:
Hello,
Thank you for your help. I have another issue. When I click on the
checkbox, it does not send that particular record to the cannibalized
table. It will send the first record or all the records depending on
what I select in the Query properties, the Top Value = "1" or Top Value
= "All". I also want to be able to delete that record once it has been
sent to the cannibalized table. Is there a specific code that can help
me with this?

Thank you again.
AP wrote:
Hello

Build an append query that references the current record on the form
and appends the record to the other table ( I will assume that it has a
similar layout)

On the afterupdate event of the checkbox run something like. Depending
on where the check box is in the data entry process you may need to add
a save command in there too. Test first by manually running the query
to see if it works as you expect.

Docmd.setwarnings false
docmd.openquery "your query here"
docmd.setwarnings true
AP
sa****@hotmail.com wrote:
I have created an inventory database in Microsoft Access 2003. In my
assets form, I have a checkbox for cannibalized computers. I would
like to be able to put a check in that checkbox and have that
particular record moved to a new table. Is this possible? If it is
possible, can someone please tell me what I need to do to get this to
work? Thank you.
Jul 11 '06 #4

P: n/a

sa****@hotmail.com wrote:
sa****@hotmail.com wrote:
Hello,
Thank you for your help. I have another issue. When I click on the
checkbox, it does not send that particular record to the cannibalized
table. It will send the first record or all the records depending on
what I select in the Query properties, the Top Value = "1" or Top Value
= "All". I also want to be able to delete that record once it has been
sent to the cannibalized table. Is there a specific code that can help
me with this?

Thank you again.
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryAppendQuery"
DoCmd.OpenQuery "qryDeleteQuery"
DoCmd.SetWarnings True

On Error
DoCmd.SetWarnings True

The checkbox doesn't do anything. It must marks the record.

And what are you doing with Top Value predicates? That has zero to do
with what you want.

Just create a query to find all the records that are checked.

SELECT...
FROM MyTable
WHERE blnCannibalized=True

then turn that into an append query and save that under a new name
qappCannibal
then turn the select query into a delete query and save it.

Of course, if you wanted to have LOTS of fun, you could be secure and
wrap the whole mess in a transaction so both queries run as a single
unit.

If you look up BeginTrans in the VBA help, it'll show you how to do it.
Oh, and mess with a dummy DB first. When you have it working, move to
the real deal.

Jul 12 '06 #5

P: n/a
sa****@hotmail.com wrote:

Thank you very much. It worked without a hitch. You have peaked my
curiosity about the BeginTrans in VB.

pi********@hotmail.com wrote:
sa****@hotmail.com wrote:
sa****@hotmail.com wrote:
Hello,
Thank you for your help. I have another issue. When I click on the
checkbox, it does not send that particular record to the cannibalized
table. It will send the first record or all the records depending on
what I select in the Query properties, the Top Value = "1" or Top Value
= "All". I also want to be able to delete that record once it has been
sent to the cannibalized table. Is there a specific code that can help
me with this?

Thank you again.

DoCmd.SetWarnings False
DoCmd.OpenQuery "qryAppendQuery"
DoCmd.OpenQuery "qryDeleteQuery"
DoCmd.SetWarnings True

On Error
DoCmd.SetWarnings True

The checkbox doesn't do anything. It must marks the record.

And what are you doing with Top Value predicates? That has zero to do
with what you want.

Just create a query to find all the records that are checked.

SELECT...
FROM MyTable
WHERE blnCannibalized=True

then turn that into an append query and save that under a new name
qappCannibal
then turn the select query into a delete query and save it.

Of course, if you wanted to have LOTS of fun, you could be secure and
wrap the whole mess in a transaction so both queries run as a single
unit.

If you look up BeginTrans in the VBA help, it'll show you how to do it.
Oh, and mess with a dummy DB first. When you have it working, move to
the real deal.
Jul 12 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.