• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 497
  • Last Modified:

Copy filtered subform into exist table

Hi Experts:}
I have a main for with 2 datasheets linked subforms (see image attached)
I need to click a button that copy the filtered subform with it`s second linked subform into a related table.
the first subform to-> tblQuery1Log and the second subfrom (with the + ) in the image
to table TempCellProp

how can i peform that in vba?
0
drtopserv
Asked:
drtopserv
  • 9
  • 5
2 Solutions
 
drtopservAuthor Commented:
0
 
Vadim RappCommented:
See attached sample. Create necessary sql statements so they include the fields you want, from both subforms, and put them in right tables.
db.mdb
0
 
drtopservAuthor Commented:
vadimrapp1, thnx alot.
but still can`t perform it in my sample4, may a help:
I need to put the result from the screenshot sample data into the tables:
tblQuery1Log AND TempCellProp
sample4.accdb
sample4.gif
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
drtopservAuthor Commented:
If u can notice, the subform has another nested subform (both are datasheet) that need to be copied to the related temp tables.
0
 
Vadim RappCommented:
What I uploaded is just a sample that shows what to do. Apply it to your case. My Access is 2003, so I can't open accdb files.

If subform has another subform, reach out to its recordset in the similar way to how it's done in the sample to the first subform. Once you have the recordset, apply the same filter as on the subform, then scroll the records.
0
 
drtopservAuthor Commented:
in the sample i gave there is 21 field in the 1 subform and 6 fields in the 2 subform.
it means from ur sample i have to write line to include each field name from the 1 & 2 subform and inject them into the related table, which i think it tiring to do it!
do u have any simple solution for that:}?
0
 
Vadim RappCommented:
> it means from ur sample i have to write line to include each field name from the 1 & 2 subform and inject them into the related table, which i think it tiring to do it!

Well, if writing INSERT statement with 21 fields is too boring, here are your two choices:

1. come up with creative code that will enumerate the fields in the subforms, and dynamically concatenate the INSERT statement

2. hiring someone who will do this project for you; use thus saved time to consider another career, in an area less boring than programming.
0
 
drtopservAuthor Commented:
Well bro,
I`m not sure that you were born programmer, also I`m sure that your first program was a creative code, I have purchased books around that started to help me out in access programming, this chan just help me out got into the goal faster.
anyway these lines doesn`t mean that i`m not appetiate your efforts(time) answering me and help out.
try to be in my side, remember the beginning time when u start programming, and the needs of the push :}
0
 
drtopservAuthor Commented:
anyway, your sample could help me around, i can  keep from there. i think you deside the points. :}
0
 
drtopservAuthor Commented:
deside=deserve
0
 
Vadim RappCommented:
> also I`m sure that your first program was a creative code

Not too creative. It was a deck of punch cards, about 100. Occasionally they were dropped on the floor, and had to be collected back into the deck, in the right order. See what I mean?

:-)
0
 
drtopservAuthor Commented:
sorry my eng is not that strong:} didn`t understand you:}
0
 
Vadim RappCommented:
This is how my first program looked like:First Program
0
 
drtopservAuthor Commented:
Real iNsane!!
wow, you have struggled enough to "BE" :}}}
"Don`t let ppl go the same way you go,,relief a bit:} /save them:}} "
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

  • 9
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now