Using forms to input data

W

Walt

I have 3 tables and I create 3 forms to input data in each table. I added a
macro to each form so once you fill it out you click next and it takes you to
the next form. My question: Is there a way I can make sure no data is input
into the tables until all 3 forms have been completed?

Thanks
 
A

Armen Stein

I have 3 tables and I create 3 forms to input data in each table. I added a
macro to each form so once you fill it out you click next and it takes you to
the next form. My question: Is there a way I can make sure no data is input
into the tables until all 3 forms have been completed?

Thanks

Not easily. Access automatically commits the records into the
database the moment you navigate to another form or subform.

If each form just has one record, you can make them unbound and write
all their data manually after the third form.

Or if some have multiple records, you can create "work" tables of your
information, then at the very end write some code to transfer the data
into the main tables.

Or you can check all the data afterwards and delete it all out again
if it isn't complete.

Hope this gives you some ideas,

Armen Stein
Microsoft Access MVP
www.JStreetTech.com
 
L

Linq Adams via AccessMonster.com

Access automatically commits the records into the database the moment you >navigate to another form or subform.

Actually that's only partly true. Moving from main form to subform or from
subform to main form does, of course, save the record to the table, but
opening a second form, navigating to it and entering data, while leaving the
first form open, does not force a save in the original form. It's record will
still be dirty when return to it.

You can prove this by having a button on the first form with the code

Private Sub Command12_Click()
MsgBox Me.Dirty
End Sub

opening the second form, enter data, then return to the first record and
clicking the button. The first form record will still be dirty.

Having said that, it would still be a logistical nightmare doing this on
three forms, checking to see if they're all complete, then dumping them if
they're not!

Armen's approach is really the only one that makes sense, if you absolutely
have to do this. To be honest, it sounds like a way to really aggravate your
end users! You fill out two forms completely, get to the last field on the
third form and find out you're missing a single piece of data, and lose all
you input data!
 
A

Armen Stein

Actually that's only partly true. Moving from main form to subform or from
subform to main form does, of course, save the record to the table, but
opening a second form, navigating to it and entering data, while leaving the
first form open, does not force a save in the original form. It's record will
still be dirty when return to it.

Yes, you're right. Thanks for the catch.

Armen Stein
Microsoft Access MVP
www.JStreetTech.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top