Form to enter data (1 Viewer)

john_gringo

Registered User.
Local time
Today, 10:51
Joined
Nov 1, 2011
Messages
87
Hi I need to build a form with a subform to collect data and save them with a "save button" into two tables, else not (do not save the data if the "save button" won't pressed)

Thanks Jiannis
 

Eugene-LS

Registered User.
Local time
Today, 11:51
Joined
Dec 7, 2018
Messages
481
Yes, it is possible, but it is better to show it on your specific example.

Can you post a copy of your application with just the form (with subforms) and required tables/queries.
Just a few (fictitious) records to understand.
 

GPGeorge

Grover Park George
Local time
Today, 01:51
Joined
Nov 25, 2004
Messages
1,775
Hi I need to build a form with a subform to collect data and save them with a "save button" into two tables, else not (do not save the data if the "save button" won't pressed)

Thanks Jiannis
The work flow described sounds like you want unbound forms, not the default bound forms Access preferentially uses. Unless there is a compelling reason to go down that path, though, bound forms are sort of like cheese pizza, the basic, classic variety on which all else builds.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 04:51
Joined
Feb 19, 2002
Messages
42,970
When you have a parent child relationship, the parent record MUST be saved before you can save any child records. Rather than using unbound forms, a common solution is to use "shadow" tables where you build the transaction and validate it and only then transfer it to the production table. You run the final process inside a transaction. Use DAO to add the parent record so you can pick up the PK, then run an append query to append the child records. Delete the data from the shadow tables when you are done.

This bloats the database so you might want to look at options for template BE's that just hold the temp tables
 

plog

Banishment Pending
Local time
Today, 03:51
Joined
May 11, 2011
Messages
11,611
This is one of those "If you have to ask its beyond your capabilities" questions. What you want to do is possible, but you really need experience with a lot of aspects of Access to achieve it. How good are you at VBA?

My first suggestion is to really consider if this is necessary. What do you think this is going to help you achieve and is that really true? You are essentially adding a confirmation step to the input process and nobody pays attention to those. Especially if that confirmation step is always part of the input process, people are going to input their data and automatically click that "Save" button no matter what without thinking it through because that's what they train themselves to do.

Think of a web page that has a popup that you must click through to "Accept All Cookes"--nobody realy pays attention to them, they just click to get that damn popup out of the way. That is what you will be creating with this "Save" functio---a mindless click event users automatically go thru.

Now, if you still want to do this then google "Unbound Form Access" the first 3 results I found where all very helpful in achieving that type of system.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 04:51
Joined
Feb 19, 2002
Messages
42,970
Paul said what I didn't want to say. There are better options than unbound forms and shadow tables. The only time I have ever needed to do this was for a payment application where the payment had to be allocated to multiple open items. So the user needed to choose dollar amounts (or balance) until the check was fully distributed. Only then was the transaction complete. The key here is that the user didn't tell me the application was complete, validation rules told me.

If you tell us the problem having incomplete records will cause, we will offer solutions that are less painful to code.
 

john_gringo

Registered User.
Local time
Today, 10:51
Joined
Nov 1, 2011
Messages
87
I am not an expert....have some VBA skills.....just a few...I need to build a DB in access for my Storage Warehouse but can't find someone to do the job locally.
Anyone who wants to involve will be paid. Am I allowed to ask this here?
 

Eugene-LS

Registered User.
Local time
Today, 11:51
Joined
Dec 7, 2018
Messages
481
Anyone who wants to involve will be paid. Am I allowed to ask this here?
solving your problem may take time and more than 1000 lines of code, but you have not shown anything for reflection and advice.
 

john_gringo

Registered User.
Local time
Today, 10:51
Joined
Nov 1, 2011
Messages
87
Sorry, I'm working on it......it's a day off today here in Greece.....:)
I will post my project later today........thanks for your kind support
 

john_gringo

Registered User.
Local time
Today, 10:51
Joined
Nov 1, 2011
Messages
87
Here is my DB
I assume I have to go through recordsets.!!!!!!
As soon as I press the save button it should create a new order record in tblOrders and then use the order number to add new records to TblOrderDetails and empty the table OrderTemp
 

Attachments

  • TECO_DB .accdb
    6 MB · Views: 248

Pat Hartman

Super Moderator
Staff member
Local time
Today, 04:51
Joined
Feb 19, 2002
Messages
42,970
Why do you think you need to do this? Specifically, why do you think the standard bound form method won't work for you?
 

john_gringo

Registered User.
Local time
Today, 10:51
Joined
Nov 1, 2011
Messages
87
I don't want to save the data instantly (if I'm right), I need to have the option to cancel the order or the invoice. With the bound method, as soon as I enter data in the form, they are stored in the table, something I want to avoid.
I am sure there are several, easier and maybe more efficient ways to do it but I am not an expert and I am choosing the easiest way for me.
:)
 

Eugene-LS

Registered User.
Local time
Today, 11:51
Joined
Dec 7, 2018
Messages
481
Hi I need to build a form with a subform to collect data and save them with a "save button" into two tables, else not (do not save the data if the "save button" won't pressed)
Only for adding new entries for now ...
 

Attachments

  • TECO_DB_v002 .zip
    61.6 KB · Views: 203

Eugene-LS

Registered User.
Local time
Today, 11:51
Joined
Dec 7, 2018
Messages
481

Attachments

  • Click the Like button v001_380.png
    Click the Like button v001_380.png
    14.8 KB · Views: 227

Users who are viewing this thread

Top Bottom