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

Home Posts Topics Members FAQ

should save button be on main form or subform?

65 New Member
Hello,

I am creating a form for data entry. The main form has personal (address, phone) information that is allready stored. the subform has blank fields for information that is being entered. The fields on the subform are stored in a different table than the personal information on the main form. Each form is bound to the corresponding table.

I use the code created by the wizard for the save button. something like:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command49_Click()
  2. On Error GoTo Err_Command49_Click
  3.  
  4.  
  5.     DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
  6.  
  7. Exit_Command49_Click:
  8.     Exit Sub
  9.  
  10. Err_Command49_Click:
  11.     MsgBox Err.Description
  12.     Resume Exit_Command49_Click
  13.  
  14. End Sub
  15.  
my question is, should the save button be on the subform, the main form, or both? The fields on the main form may be altered if user notices an error in personal information.

Thanks in advance for your time.
Jan 17 '07 #1
4 2523
ADezii
8,834 Recognized Expert Expert
Hello,

I am creating a form for data entry. The main form has personal (address, phone) information that is allready stored. the subform has blank fields for information that is being entered. The fields on the subform are stored in a different table than the personal information on the main form. Each form is bound to the corresponding table.

I use the code created by the wizard for the save button. something like:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command49_Click()
  2. On Error GoTo Err_Command49_Click
  3.  
  4.  
  5.     DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
  6.  
  7. Exit_Command49_Click:
  8.     Exit Sub
  9.  
  10. Err_Command49_Click:
  11.     MsgBox Err.Description
  12.     Resume Exit_Command49_Click
  13.  
  14. End Sub
  15.  
my question is, should the save button be on the subform, the main form, or both? The fields on the main form may be altered if user notices an error in personal information.

Thanks in advance for your time.
The Save Button can go on the Main Form.
Jan 17 '07 #2
freeskier
65 New Member
OK I am still not doing something right. My main form has two subforms one to check address information the other for information to be entered.

There is a combo box on the main form to select what person to check / add information for. The combobox's control source is the personID field.

When I save I get TWO new records
(1) just the personID and
(2) just the information entered and no personID.

I think it is saving the main form's only bound field (the combo box -> personID) and then saving the subforms as a different record.

Thanks for your help
Jan 18 '07 #3
freeskier
65 New Member
OK I am still not doing something right. My main form has two subforms one to check address information the other for information to be entered.

There is a combo box on the main form to select what person to check / add information for. The combobox's control source is the personID field.

When I save I get TWO new records
(1) just the personID and
(2) just the information entered and no personID.

I think it is saving the main form's only bound field (the combo box -> personID) and then saving the subforms as a different record.

Thanks for your help
never mind I fixed it. think I need more sleep. sorry for the bother.
Jan 18 '07 #4
NeoPa
32,556 Recognized Expert Moderator MVP
never mind I fixed it. think I need more sleep. sorry for the bother.
Lol - let us know if you have more problems.
Jan 18 '07 #5

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

Similar topics

4
by: Saintor | last post by:
The following function works when used directly from a form. It locks controls depending on a value stored in the tag property. Called from a button on a subform, it does not work . TIA. ...
0
by: Colin | last post by:
In access 2000 I need to filter records in a Subform by pushing a button on a command button located on the Main form. The Main form is blank. Its only purpose is to contain the subform which is...
2
by: Colin | last post by:
I have a main form with a command button on it that when clicked, opens a subform displaying records that relate to the main form. I would like to disable the command button if the corresponding...
2
by: dskillingstad | last post by:
I'm trying to assign a custom value to a textbox. Here's what I have. I've created a module and "default value" code for a textbox which generates a custom auto-number (yyyy-0000) when a New...
1
by: Chris | last post by:
I need a search form to perform. I have a Form and a subform. The subform is based off a query and the main form is unbound. The query runs perfect, however, I have a command button in the main...
51
AccessIdiot
by: AccessIdiot | last post by:
Hi there, I would like to put a button on my form that enables or unlocks the subform and at the same time disables (locks) the main form until the user is done with the subform. At that point the...
4
by: Whasigga | last post by:
Hi I've created a form that has 7 subforms. It is the same subform, bound to a table, just repeated. This form represents a week, and each subform is used to enter in data for each day of the...
1
by: feeman | last post by:
I have a form in access 2000 with a combo box containing names, this is linked to a sub form by the name index. on the sub form is a button that when pressed automatically enters the date into the...
1
by: QCLee | last post by:
Hello Sir, Im here again asking for help. I have a form and a subform relate to HVAC Windward Table. i have a SAVE button on the form that when clicked it saves data on the HVAC Windward Table but...
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...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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 ...

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.