insert to a table from another table with create a record in named data macro (1 Viewer)

mana

Registered User.
Local time
Yesterday, 16:19
Joined
Nov 4, 2014
Messages
265
hello

i want to add data from a table with some criteria to another table. when i use foreachrecord i have the error that create a record cannot be used in foreachrecord order. i Want to know what can i use instead of that? can you help me please?
my problem is extreme and emergency and i searched a lot but i diddn't find a solution, i also attach the foto
do you have any ideas?
thank you
 

Attachments

  • Unbenannt.jpg
    Unbenannt.jpg
    97.7 KB · Views: 217

Trevor G

Registered User.
Local time
Today, 00:19
Joined
Oct 1, 2009
Messages
2,341
Have you tried the append query approach rather than in a macro and if this works then use the macro to run the query.
 

mana

Registered User.
Local time
Yesterday, 16:19
Joined
Nov 4, 2014
Messages
265
hello

but there is no append query in ms access web. this feature is not existed in ms access web.
 

PotatoPancakes

New member
Local time
Yesterday, 16:19
Joined
Aug 19, 2015
Messages
8
hello

i want to add data from a table with some criteria to another table. when i use foreachrecord i have the error that create a record cannot be used in foreachrecord order. i Want to know what can i use instead of that? can you help me please?
my problem is extreme and emergency and i searched a lot but i diddn't find a solution, i also attach the foto
do you have any ideas?
thank you


Have the criteria you want to copy display on a form. Then, set a variable for each field displayed that you want to copy. Have the macro change the view to save the information to the other table. Set the fields on the pop-up to your variables.

It's a similar problem I was having...

http://www.access-programmers.co.uk/forums/showthread.php?p=1446945#post1446945
 

mana

Registered User.
Local time
Yesterday, 16:19
Joined
Nov 4, 2014
Messages
265
thank you very much for your answer
can you explain it more please?
I really have problem and don't find any solutions
I want to insert data from a query to a table in ms access web
i don't want that the data should be shown in a form
i don't know exactly what to do?
thnak you
 

PotatoPancakes

New member
Local time
Yesterday, 16:19
Joined
Aug 19, 2015
Messages
8
is this a one time copy? If so, run the query and manually copy/paste the data. Ctrl+C, Ctrl+V
 

mana

Registered User.
Local time
Yesterday, 16:19
Joined
Nov 4, 2014
Messages
265
no i want to do this many times automatically
 

PotatoPancakes

New member
Local time
Yesterday, 16:19
Joined
Aug 19, 2015
Messages
8
Is there a reason to copy? Why not just write the original data in the table you want to copy it into? Can you explain you table structure and process to me?
 

mana

Registered User.
Local time
Yesterday, 16:19
Joined
Nov 4, 2014
Messages
265
I have a table and i want to have data of this table with some criteria in another table. i want to add some other fields to this table and do something on them.

i have a table as checkpoints:
Id
checkname
questions
creation date
...

i have a table as projects
id
projectname
real time
.....

each project can have different checkpoints

such as

p1 c1 is workingcolumn
p1 c2 is workingcolumn
p1 c3 is workingcolumn
p2 c1 is workingcolumn
p2 c2 is workingcolumn
p2 c3 is workingcolumn
....

so i copy all of the checkpoints data to a table and then add the name of the projects to them
then i check the workingcolumn or not check it

for each of the projects i need the checkpoints those creation date is less than real time of the project
 

PotatoPancakes

New member
Local time
Yesterday, 16:19
Joined
Aug 19, 2015
Messages
8
Here's what I would do. I don't think this is something a query would handle to copy/paste data. There is nothing currently connecting the checkpoint and projects table, so how would Access know which info to copy over.


1) Create the new table you want to insert the data with the proper fields you want to store.
2) Create queries based on the data you want to copy.
3) Create a form to enter the data into the new table.
4) Use combo boxes to have the user select an aspect of both the checkpoint and project you want to join. Cascading combo boxes will be your friend here and are very easy with AWA.
 

mana

Registered User.
Local time
Yesterday, 16:19
Joined
Nov 4, 2014
Messages
265
But my data come from a query and I don't want to enter the data
How can I bring the data from my query to this form?
 

JulianKirkness

Registered User.
Local time
Today, 00:19
Joined
Apr 15, 2015
Messages
14
Hi - you definitely can use CreateRecord inside ForEachRecord loops (I have many times) so I don't quite understand why you are getting an error. It may be worth a) trying to use Aliases for ForEachRecord and CreateRecord actions and b) try using Data Macro Tracing to see where the error occurs and c) if that fails post details of the actual error you receive.
 

Users who are viewing this thread

Top Bottom