Solved

Copy filtered subform into exist table

Posted on 2013-06-20
16
480 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
  • 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
 

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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

912 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now