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

How to create a record using data from another table?

P: 1
Hi,

First of all, I thank you for reading the following post and taking a little bit of your time helping me figuring this out.

I first tryed to explain my exact case, but it is to hard. Let me try to explain it in a generic way:

I would like to read several information stored in one table [cross] for 2 records each time (which IDs are stored by pair in a table [pair_of_IDS]), put them in an array so that I can make some computation, and then use the data in my array to populate a new record in my [main] table.

I am almost new in VBA for access but I can handle VBA in Excel quiet well.

I guess I need to use a sub which will for each pair of remarkable deals (2 IDs found in [pair_of_IDs].) first read the relevant data from [cross], then store them in an array (X,2), do the relevant computation, then write the new record in [main].

This quiet hard to explain, I hope it is understandable.

I DO THANK YOU IN ADVANCE FOR YOUR INSIGHT,

jhoelter
Nov 14 '09 #1
Share this Question
Share on Google+
2 Replies


P: 83
Perhaps it would be more clear if you used a concrete example to demonstrate what you are try to accomplish.

I have 2 widgets....
Nov 14 '09 #2

NeoPa
Expert Mod 15k+
P: 31,306
It seems there would be two ways of doing this (if I understand you correctly). The actual problem isn't too clear (although you've started well enough), but I would think you could either produce the results required with an append query which linked two record sources to produce cross related information which, with some manipulation possibly, could be added into your Main table.

Alternatively, you could use some VBA redordset processing (See Access VBA DAO Recordset Loop Using Two Recordsets), load the data into your code and add the new record to your Main table using recordset processing too.

This is basic I know, just an outline. Anything more would need an explanation to fill in some details. Perhaps orangeCat's idea of providing an example situation would be helpful for us. It's always helpful to get some sort of perspective.
Nov 15 '09 #3

Post your reply

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