[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 781
  • Last Modified:

Access Data Entry form with tab control and multiple pages

Hoping to get help with this.
I have a Data Entry form. On this Form is a Tab Control with 5 Pages and on each of the pages are subforms. The Main form properties are set to data entry yes and the Record Source is tbl_Master. The first 4 pages will populate the tbl_Master as well.
 The idea is:
The Main form data and the first 4 tabs of subform data are one record that goes into the tbl_Master and the 5th tab would populate the tbl_memos

On the main form are:
CaseID (Autonumber) field
AccountNo field
AnalystName field.
 The user types in an AccountNo and chooses their name from the drop down AnalystName which issues the CaseID. This autofills some data in all forms based on the accountNo and an AfterUpdate event that opens a query.

My issue is a record is created when the user enters in the accountNo then when you click on the first tab to enter info not populated it creates another record etc for each tab so I get an error regarding creating a duplicate entry and can't move forward to enter.

How can I make the main form and first 4 tabs subforms be one record in the master table and the 5th tab be a related record in the memos table. These are related by CaseID and I have the CaseID field in the fifth tab pulling the CasedID from the Main form.

My idea is to be able to have the user Click a save button after all entry is complete to save the records instead of the data automatically updating the tables.

I am not sure how to accomplish this. Help Help!!!

Any Help is appreciated.

Kelly

0
kmoyer9717
Asked:
kmoyer9717
  • 2
  • 2
2 Solutions
 
peter57rCommented:
There is no point in having multiple subforms for the main record.
Just put the fields on different tabs of the tab control.
The main record will be saved when you move to the one remaining subform.
0
 
Boyd (HiTechCoach) Trimmell, Microsoft Access MVPCommented:
How can I make the main form and first 4 tabs subforms be one record in the master table

Simple. Don't use sub forms for the same record.

Sub forms normally should be used to view a different record.

Note: When you move from a parent form to a sub form the parent form must be saved.
0
 
kmoyer9717Author Commented:
got rid of the subforms on the tab controls except for the last tab which adds to a different table. This fixed the issue of the duplicate record error.
The only issue now is the data is automatically saving to the table and not showing in the form so that I can enter in what does not autofill.

Help!!!!
 Also is there a way to change the color of the tab control?
0
 
peter57rCommented:
Access saves the main form record when you move from the main form to the subform.  You can't stop this happening.

I don't understand what you mean with..
"...and not showing in the form so that I can enter in what does not autofill."


0
 
kmoyer9717Author Commented:
I am issuing the points for the subform portion of the question.

I fould a solution to the user closing out of the form with a partial record.

In the Before Update event property I put the following.

If MsgBox("Do you want to save this record ??", vbYesNo + vbDefaultButton2, "??????") = vbNo Then
  Cancel = True
  Me.Undo
End If

This prompted the user before they closed the form and if they canceled it undid the record.

Thanks for the help.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now