Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Copy filtered subform into exist table

Posted on 2013-06-20
16
Medium Priority
?
489 Views
Last Modified: 2014-05-14
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
Comment
Question by:drtopserv
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 5
16 Comments
 

Author Comment

by:drtopserv
ID: 39264047
0
 
LVL 40

Accepted Solution

by:
Vadim Rapp earned 2000 total points
ID: 39265812
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
 

Author Comment

by:drtopserv
ID: 39266260
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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

Author Comment

by:drtopserv
ID: 39266261
If u can notice, the subform has another nested subform (both are datasheet) that need to be copied to the related temp tables.
0
 
LVL 40

Assisted Solution

by:Vadim Rapp
Vadim Rapp earned 2000 total points
ID: 39266328
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
 

Author Comment

by:drtopserv
ID: 39267207
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
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 39267311
> 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
 

Author Comment

by:drtopserv
ID: 39267324
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
 

Author Comment

by:drtopserv
ID: 39267327
anyway, your sample could help me around, i can  keep from there. i think you deside the points. :}
0
 

Author Comment

by:drtopserv
ID: 39267330
deside=deserve
0
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 39267340
> 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
 

Author Comment

by:drtopserv
ID: 39267345
sorry my eng is not that strong:} didn`t understand you:}
0
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 39267417
This is how my first program looked like:First Program
0
 

Author Comment

by:drtopserv
ID: 39267552
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

Featured Post

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question