Solved

Copy filtered subform into exist table

Posted on 2013-06-20
16
484 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 500 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 500 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. This article shows how to create one of these functions to write directly to Azure Table Storage.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

749 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