473,382 Members | 1,258 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

How to loop through subform records, update the 2nd row in a subform

Hi. I have a Main form with a Subform. My Main form generates an ID and some info is passed to the subform alongwith the ID. Lets say some changes are made to the mainform, this info is then added to the subform as a new record with the same ID (as in the main form) i.e saved as a 2nd record in my subform and will show under the main forms ID as 2 records. There are times when I have to generate the same values of the main form and capture the data as a new record in the mainform. I am able to do this for the main form, but I can only update the first record withtin the subform. inspite of using loops, movenext etc etc, I am unable to move to the next record to update it with the Main form ID. How do I copy the data in the subform and add it as a new record in the subform with the new ID generated in my Main form. Am i doing sumthing wrong in the loop? I need the solution ASAP and hence have posted this problem here for the first time as I cannot figure this bit of code...I would say I am an intermediate Access user with fair bit of access knowledge..

btw, pls also note that after the 1st record is updated, I get a write conflict as well...

Any help to resolve these 2 issues (which I believe are interlinked) would be appreciated.
Aug 18 '10 #1
2 3058
Jerry Maiapu
259 100+
I do not really understand what you are trying to say.
You did not post any code, though you mention that you did tried something.
You are trying to:
1. Copy some info from parent form into a new record in subform?
2. Change/Edit values for all records in datasheet/subform from Main Form?

Can you make your question more clearer.?

You maight have a look at this thread Inserting values into subform datasheet from main form.. It's similar to what your are trying to say.
I found the solution myself
Sep 5 '10 #2
NeoPa
32,556 Expert Mod 16PB
I'm not clear what you're trying to achieve Gavin, but I would say that any design where a subform is bound to the same data as the main form is not recommended and is very likely to leave you facing such data contention issues. Fundamentally and logically it is an illogical setup.

I would give consideration to exactly what you are hoping to achieve here and try to come up with a more appropriate design for it.
Sep 7 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Maggieanp22 | last post by:
I'm designing a db which stores client details but each client has multiple 'occasions'. For each occasion there is a section which has items purchased (there are sometimes none, sometimes...
0
by: Paul T. Rong | last post by:
In form ¡°Order¡± there are 4 important controls: - combo1 (unbounded, source from ProductID field of Product table), - txt1 (I wish the product name will automatic show here after the user inputs...
1
by: Terri | last post by:
I'm summing subform records in a control on a main form. I have a control in the subform footer called TotalAmount with the control source =Sum(). On my mainform control I reference this control...
6
by: ryan | last post by:
I created in design view a subform within a subform. However the subform within the subform in only visible in design view. In form view the subform within the subform is not visible. I have...
4
by: tlyczko | last post by:
I have been looking on the NGs and I found this code to show if a subform has no records. I have this code in the MAIN form OnClose event: Private Sub btnClose_Click() '4/16/06 new code that...
1
by: jmarr02s | last post by:
Is it possible to limit the number of Subform records using MS Access 2003? That is, my end users want the capability of entering up to 12 records on their subform. Is that possible? ...
4
by: Macbane | last post by:
Hi, I have a 'main' form called frmIssues which has a subform control (named linkIssuesDrug) containing the subform sfrmLink_Issues_Drugs. A control button on the main form opens a pop-up form...
3
by: paquer | last post by:
On my Main form I have a Command Button that opens a Subform in order to create a new Subform record. At this point I want the subform to show only the new record being created. Not all the...
4
by: NJonge01 | last post by:
I posted a similar problem weeks ago, and I received some great advice but none of which I was able to apply successfully. I suspect that part of the problem was I had already begun the work myself,...
0
by: jwbird | last post by:
I have a main form with multiple Subforms that are all displaying Datasheet information related to the Main form record. When I make changes/adds to the records(s) in the subform and tab to another...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.