473,408 Members | 1,741 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,408 software developers and data experts.

MS.Access: Copying a single row from one table to another using checkbox

3
I am just learning VBA thru online.. and I couldn't find a solution.

I got these code

CurrentDB.Execute "INSERT INTO Table1 SELECT * FROM Table2 WHERE AppID = " & Me.AppID & ";"

but the problem is all the data in other table will be copied. what I only want is a single row with all the columns will be copied with respect to the checkbox I checked. I am designing that every row has its own respective checkbox.

Thanks!
Jan 3 '19 #1
7 1468
NeoPa
32,556 Expert Mod 16PB
Have you tried it? Or are you just guessing? The SQL looks fine to me as far as it goes.

Let's try to get this question expressed properly before we continue. There is an expectation to put some effort into your question before posting it. This is sloppy and shows minimal effort.
Jan 3 '19 #2
jems
3
I think you didn't get what I mean, the code is working but it will copy all data when clicking a checkbox. what i want is a code that will only copy a certain row with respect to the checkbox i checked. by the way im using MS access 2013.
Jan 3 '19 #3
twinnyfo
3,653 Expert Mod 2GB
jems,

Welcome to Bytes!

I think we do get what you mean. However, what NeoPa is referring to and asking for is whether you have actually tried anything in order to get just the one record copied.

You say you are just learning VBA, which is fine--we've all been there. However, your issue has less to do with VBA than it does with SQL (Structured Query Language) which is the language queries are made of. Do you understand how to add criteria clauses to your SQL statements (e.g. "WHERE ...")? This is where it starts.

Aside from that, without knowing anything about your check boxes and forms and everything else, it is impossible for us to guide you through anything further--especially since you have not provided any attempt to resolve the issue yourself--other than simply state that your current query copies all records.

I hope that clarifies.
Jan 3 '19 #4
NeoPa
32,556 Expert Mod 16PB
Jems:
I think you didn't get what I mean
Absolutely. That was what I was trying to explain to you. Your question was expressed so poorly that no-one could understand what was wrong or help you fix it.

I also asked pertinent questions of course - in order to lead you towards giving helpful information we can actually work with. Unfortunately you seem to have ignored them.

My last comment (of the earier reply) seems to have led to no change in that respect so I'm really not sure what you expect. If you seriously want some help, and are prepared to put in the minimal effort required to explain your problem clearly, in view of what we've already explained is neded, then here's your opportunity. It's a last one as far as I'm concerned.
Jan 4 '19 #5
jems
3
Sorry for the confusion.

Let me elaborate my issue in access; I have 2 TABLES (tb1 & tb2) with multiple FIELDS, while tb1 are filled with data. and I have FORM with checkboxes(cb1, cb2, cb3, etc...). If I check cb1, all fields data from first row of tb1 will be copied to tb2, and cb2 will copied second row and so on... the point is, I only want to select what I need to copy from tb1 to tb2.

I hope it's much clear now. I am not good in access also, I'm just learning piece by piece.

Thanks!
Jan 6 '19 #6
NeoPa
32,556 Expert Mod 16PB
I'm starting to get a picture of what you're trying to do, although what you actually say still doesn't make sense. How can you have multiple CheckBoxes on a form that have different names and that are for different records. I can see there being one per record if you have Continuous Forms set, but otherwise how do you imagine you're going to match the number of records with the number of ComboBoxes?

PS. My first question is still outstanding. That makes two now as there's one in here too now. If we get answers we * May * be able to continue.
Jan 6 '19 #7
Thanks for the information.
Jan 7 '19 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Gert Schumann | last post by:
I want to delete just parts of tables, so I can't use 'TRUNCATE'. As I want to delete about millions of lines, I need a very big rollback segment. The best way would be to delete without using...
1
by: Caroline | last post by:
I need to update a table by copying a column from another table (having the same structure, but on another database), from the record having the same primary key. 1 - What is the correct...
2
by: troy_lee | last post by:
What is the best way of copying all the records from a linked table into a replica table that is local on my computer? This is for development work at home where I can not access the main table. Is...
13
by: ramprakashjava | last post by:
hi, i hav "java.lang.NullPointerException" error while Deleting table records using checkbox in jsp here i enclosed files help quickly plzzz.. ...
1
by: puneetmca | last post by:
hi...this code of deleting a record from database using checkbox is not working...echo "<td>$row</td>; echo "<td>$row</td>"; echo "<td>$row....these lines print as it is...rather then...
0
by: SDEIT | last post by:
Hi , I am having a folder containing diff excel files with same pattern of data (diff rows and same columns with column header). I want to put all the datas in to a single oracle table so that...
1
by: johnson1314310 | last post by:
duplicate rows occurring when using inner join,i want to join a table value to another table..
0
by: Bharthish k v | last post by:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using...
3
by: Greg04 | last post by:
Hi , I am using below code to fetch numbers in columns of a table ....into rows of another table.... It works fine for first row of the source table and fetches first entry but doesn't loop through...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.