MS ACCESS - CONTINUOUS FORM

  • Thread starter Thread starter Syed ubaid
  • Start date Start date
S

Syed ubaid

NORMALLY BOUND CONTINUOUS FORMS AUTOMATICALLY
INSERT/PREPARE A BLANK RECORD. AS USER CLICK IN THAT
RECORD AND TYPE ANY THING, ANOTHER NEW BLANK RECORD IS
APPENDED.

I WANT TO BYPASS THIS BEHAVIOR!!!!

A CONTINUOUS FORM SHOULD APPEND A FRESH RECORD ONLY WHEN
USER CLICK ADD NEW BUTTON AND ALL APPENDED RECORD SHOULD
BE COMMITTED TO TABLE WHEN USER CLICK SAVE BUTTON. IF USER
CANCEL THEN RECORDS (APPENDED BY USER) SHOULD BE
CANCELLED. ANY SOLUTION.?????

SOME ONE CAN SAY ME.ALLOWADDITION OR ME.ALLOWEDITS
PROPERTY, I USED IT BUT IT DID NOT WORK.

I NEED AN URGENT REPLY. I M IN A BIG TROUBLE.
 
Please don't type in all caps. It is considered shouting and is also hard to read.

Open the form in design view. On the View menu choose Form Header/Footer to show the
form's header and footer. Place the buttons you want in the header or footer and shrink
the height of the unused section to zero.

1) To allow additions, one button would toggle the AllowAdditions property in its OnClick
event.

Me.AllowAdditions = Not Me.AllowAdditions

Each time the button is clicked, the AllowAdditions property will be reversed. You could
also set it to True or False if you only want it to go one way. When False, it will get
rid of that extra row waiting for a new record.

2) For the Cancel button you would place the following in the OnClick event:

Me.Undo

This will undo the current record being entered, canceling it. It won't undo any record
the user has already appended (saved).

3) For the Save button, use the following in the OnClick event:

RunCommand acCmdSaveRecord



If you are wanting to have the user enter a "batch" of records then save them all at once,
then the Add button would need to change the RecordSource of the form to a temporary table
that has the same field structure as the table you were reading records from and set
AllowAdditions to True. Add your new records. If you click the Cancel button, delete all
the records in this temporary table (run a Delete Query), set AllowAdditions to False, and
change the RecordSource back to the real table or query. If you choose Save, you would
append the records from the temporary table to the real table (Append Query), delete the
records in the temporary table (Delete Query), change the RecordSource of the form back to
the real table/query, and set AllowAdditions to False.
 
Back
Top