473,414 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Checkbox Issue

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
5 1703
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

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
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

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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Bill | last post by:
I have a catalog of books which need to be categorized into different groups. Some of the books can be listed under more than one category. I'm creating a page where I can assign a group of books...
1
by: David Wake | last post by:
I have two radio buttons and two checkboxes in a form. I'm trying to write some code so that when a radio button is selected, its corresponding checkbox is disabled. My code looks like this: ...
4
by: | last post by:
I have a checkbox on a web page. When it is checked, I want a Table to appear (or disappear when the checkbox is cleared)... I was hoping to use client side code for this, so I created a short...
3
by: Fao, Sean | last post by:
I have a DataGrid that I'm adding CheckBox controls to at runtime (in the code behind) and I'm not sure if I'm doing it correctly. First of all, I noticed that the MyDataGrid.Columns.Add() method...
4
by: Matrixreloadedth | last post by:
How to change disable color of Checkbox??? I have a checkbox with forecolor in red but when i disable by set Enable properties to false forecolor is changed to gray color but i don't want it. how...
1
by: peck2000 | last post by:
Related to my earleir post ... this is the same project to re-purpose the Classifieds application in BEGINNING ASP 3.0 (Wrox) to a comicbook database ... This is a brainteaser that should have...
1
by: Ben | last post by:
Hi, I'm designing a c# page and trying to add a checkbox column to a GridView, I've added a Template Row (as described at: http://aspnet.4guysfromrolla.com/articles/052406-1.aspx) and in the...
1
by: Danielle | last post by:
Greetings all and thanks in advance for any help you can provide. I am trying ultimately to get values from a gridview row when a checkbox on the row is checked. the problem I'm having is that...
0
by: dotnetrookie | last post by:
Hi This is my 1st post.I have two checkbox columns in gridview binded through item template. The checkboxes are Category and Subcategory. I have actually removed the duplicate values in the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.