UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> VBA Programming    
 
   
desiretolearn
post Jun 6 2014, 02:46 AM
Post#1



Posts: 1
Joined: 6-June 14



Hi All,

Am new to VBA programming. I have a requirement wherin i need to transfer data from two tables in MS-Access to other table in same DB.
For Ex:

I have created 3 tables say A B and C, i need to take data from A and B with some criterias and put it in table C.

Please guys help me out.

Thanks in Advance..
Go to the top of the page
 
Jeff B.
post Jun 6 2014, 05:13 AM
Post#2


UtterAccess VIP
Posts: 9,886
Joined: 30-April 10
From: Pacific NorthWet


welcome2UA.gif
efore you pursue this path further, consider reviewing the material available here at UA re: relational database design and normalization. It is NOT usually a good practice (or use of the tool) to copy information in one table over to another table. That sounds more like what someone would do if they were limited to using a spreadsheet.
Good luck!
Go to the top of the page
 
CyberCow
post Jun 6 2014, 06:59 AM
Post#3


UdderAccess Admin + UA Ruler
Posts: 19,555
Joined: 27-April 02
From: Upper MI


desiretolearn - welcome2UA.gif
Is Jeff points out, you can find a series of great links on "normalization" in the Newcomer's Reading List. "Normalization" is one of the primary concepts behinds good data modeling to ease up the coding requirements of most databases.
hope this helps hat_tip.gif
Go to the top of the page
 
the_captain_slog
post Jun 6 2014, 07:13 AM
Post#4



Posts: 1,036
Joined: 1-July 09
From: England - UK A small island north of France


so why use VBA -- are you able to write an SQL query to do this?
if you cant do it in SQL you wont get far with doing it in VBA
Go to the top of the page
 
dmhzx
post Jun 6 2014, 07:23 AM
Post#5



Posts: 7,033
Joined: 22-December 10
From: England


Have to disagree with that Captain.
lot can be done with the QBE, knowing precious little about SQL.
Similarly a lot can be done with VBA, going nowhere near SQL. (I recently wrote a disk backup utility in VBA with no SQL or recordset stuff at all.)
HAs a learning exercise DTL's task could probably be done with saved queries, or a bit of looping and recordset manipulation.
So I would regard a knowledge of SQL (as such) as a useful add on to VBA , as opposed to a pre -requisite. - At least that was how I interpreted your po
Go to the top of the page
 
the_captain_slog
post Jun 6 2014, 07:39 AM
Post#6



Posts: 1,036
Joined: 1-July 09
From: England - UK A small island north of France


Dmhzx - sorry I should have stated query not SQL
asically what I was saying is if you cant create a query to do this then why try to do it in VBA
Go to the top of the page
 
dmhzx
post Jun 6 2014, 08:17 AM
Post#7



Posts: 7,033
Joined: 22-December 10
From: England


Thanks for the clarification Captain.
ice to see that we agree with each other.
Ofelt it was important in this case, because OP said they were new to it.
David
hat_tip.gif
Of course it MAY be that the conditions are so complex, that a bit of VBA may well be a rational route -- but we don't know
Go to the top of the page
 
the_captain_slog
post Jun 6 2014, 09:30 AM
Post#8



Posts: 1,036
Joined: 1-July 09
From: England - UK A small island north of France


Dmhzx
Looking again at the Op's question its for V Basic 6 so does that include a QBE?
Go to the top of the page
 
ScottGem
post Jun 6 2014, 09:43 AM
Post#9


UtterAccess VIP / UA Clown
Posts: 32,185
Joined: 21-January 04
From: LI, NY


The OP posted in a VB 6 forum, but referred specifically to VBA and Access. So the post is probably misplaced.
esire,
Hope you will come back and explain your needs. At UA we tend to post answers that adhere to best practices. Since moving and, especially, copying data from one table to another is not considered best practices we would like to understand the business reasons for doing so. We might be able to offer a better alternative.
Go to the top of the page
 
CyberCow
post Jun 6 2014, 05:35 PM
Post#10


UdderAccess Admin + UA Ruler
Posts: 19,555
Joined: 27-April 02
From: Upper MI


desiretolearn - ScottGem raises a good question. Are you working with VB or Access and VBA please? (There is a significant difference.)
Go to the top of the page
 
dmhzx
post Jun 9 2014, 04:42 AM
Post#11



Posts: 7,033
Joined: 22-December 10
From: England


I only read the question: Never noticed the title. dunce.gif
It's been a long time since I worked with VB as such, and I can't remember if it had a QBE or not. - I may be confusing it with SQL: But in either case, IMO it's not as good as the one built into Access.
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    18th December 2017 - 03:19 PM