473,473 Members | 2,232 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Programatically Enter Data Into main Form And Subform

I have a bound form and subform and am trying to enter the data in both forms
programatically. The Linkmaster and Linkchild properties are set. My intent is
to be able to look at the data before it is saved and then choose to save it or
undo it. I have a Save button that just closes the form and a Cancel button that
does an undo and then closes the form. I first enter data into the main form
and then enter code into the subform. After the code runs, I get an error
message that essentially says there is no matching value for the foreign key in
the main form's table. If I programatically save the main form record after
entering the data in the main form and then go on to programatically enter the
data in the subform, the code runs and no error arises. However, I then have a
saved record that I can not undo. I'm concerned that if I code to delete rather
than undo, when the database is in use, deleting will lead to bloating the
database.

How can I programatically enter data into both the main form and subform without
having to first save the data in the main form?

Thanks!

Susan
Nov 13 '05 #1
1 3482

"Susan" <ss******@earthlink.net> wrote in message
news:X_**************@newsread3.news.atl.earthlink .net...
I have a bound form and subform and am trying to enter the data in both forms programatically. The Linkmaster and Linkchild properties are set. My intent is to be able to look at the data before it is saved and then choose to save it or undo it. I have a Save button that just closes the form and a Cancel button that does an undo and then closes the form. I first enter data into the main form and then enter code into the subform. After the code runs, I get an error
message that essentially says there is no matching value for the foreign key in the main form's table. If I programatically save the main form record after entering the data in the main form and then go on to programatically enter the data in the subform, the code runs and no error arises. However, I then have a saved record that I can not undo. I'm concerned that if I code to delete rather than undo, when the database is in use, deleting will lead to bloating the
database.

How can I programatically enter data into both the main form and subform without having to first save the data in the main form?

Thanks!

Susan

You want to programmatically enter data into a main form and a related
subform, but you don't know if you want to save it?
Interesting. Why not decide if you want to save the data BEFORE you
programmatically enter the data into the main form and the related subform?

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: deko | last post by:
I have two subforms within a particular form. The one on top is a datasheet of transactions; the one on the bottom is a summary of totals. I would like to have the datasheet fill the entire...
1
by: Traci | last post by:
My problem is in a form/subform. On the main form I have an unbound listbox named OptionsInPlan. In the OnCurrent event of the main form I set the value of the listbox with the code:...
1
by: John | last post by:
My data has 10 accounts. Two forms are opened simultaneously. Form1 is unbound and displays three records: Account Quantity 101 17 104 25 107 ...
1
by: savas_karaduman | last post by:
There is a subform embedded into a Main Form... Subform is standing for entering data into a table... There is a combobox on the Main Form... How Combo Box value can be added into table to which...
3
by: Darin | last post by:
I have a problem I just can't figure out. I have a form with a subform, and the recordsource of the subform has criteria based on some unbound fields in the parent form so that data in the parent...
4
by: Deano | last post by:
I have a little search routine going whereby the user types in some text and clicks a button on the main form. I then see if that text exists in a record on the subform. I get a match, grab the...
4
by: jmartmem | last post by:
I have an Access 2002 main form ("Project Initiation Checklist") with a subform ("sfPICMilestone"). The Link Child Field is ID and the Link Master Field is also ID. The linked field is an...
1
by: janekelly111 | last post by:
I have a main form with one subform linked by a one-to-many relationship on one field only. The main form;s recordsource is a query determined and assigned from a command button on a "Find" form...
19
by: postman | last post by:
I have a parent form bound to a recordsource and several controls are bound to fields in that recordsource. There are also several unbound controls that are used to display various data in a...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.