Restricting access to previous forms?

  • Thread starter Thread starter Bryan
  • Start date Start date
B

Bryan

How do I restrict someones ability to view prevous
entered forms? I want the data entry person to only see
a blank form. I'm desperate and almost done... For now.

Thanks in advance...

SPC Bryan Giesbrecht
396th Combat Support Hospital
"A long way from home" - US Army
 
Bryan said:
How do I restrict someones ability to view prevous
entered forms? I want the data entry person to only see
a blank form. I'm desperate and almost done... For now.

Bind the form to a query with impossible criteria.

SELECT * FROM YourTable WHERE 1 = 0

Then in the AfterInsert event...

Me.Requery
 
Bind the form to a query with impossible criteria.
WOW!!! I'm great with medical emergencies, but this
computer stuff is all new to me. I'm not sure what you
mean...

Well you're original message did not indicate that you had very little working
experience in Access so I assumed that you would be familiar with these procedures.

Forms that are used to enter data in Access are generally "bound" to a table, query,
or SQL statement. This is determined by the Record Source property of the form when
looked at in design view. By binding the form in this manner, data changes made in
the form are automatically made in the underlying tables without you having to do
anything specific to make this happen.

If you bind your form to a query or SQL statement, these can include filter criteria
to limit the records that the form will display. Therefore an impossible criteria
like WHERE 1=0 will always return zero rows and the form would be blank. You can
alternatively set the DataEntry property of a form to True and it will also open
blank for the purpose of entering new records. Perhaps that option would fulfill
your needs and it would be simpler to implement. The difference between using
DataEntry mode and using a zero-records RecordSet is that the user can open a form in
DataEntry mode and then use the menus/toolbars to "Remove All Filters". If they do
that then they will see all of the records displayed in the form. This is not
possible with a zero-records RecordSet.

If you choose to use a zero-record RecordSet the form will initially open blank.
After the user enters a record and advances to add a second, the first record will
still be available to them if they navigate backwards. If they entered 100 records
in a single session, they would be able to navigate to any of them. By issuing a
Requery command to the form after each insert, the previously entered records are
removed from view and the user will never have access to any record other than the
current "New" one they are entering. Again, perhaps this exceeds your requirements.

To apply the impossible criteria, open your form in design view and find the
RecordSource property. This will either be the name of a table, the name of a query,
or an SQL statement. Regardless of which it is, you can click on the build [...]
button at the right of the property to bring up a query design tool for the RecordSet
and then just add the 1=0 criteria into the criteria section of an empty column.

To Apply the Requery command, go to the form's property sheet and look at the Events
tab. Find the event named "After Insert" and from the drop-down list, select "[Event
Procedure]". Then click on the build button [...] at the right. This will take you
to the code module window where you can enter...

Me.Requery

.... between the Sub and End Sub lines that Access will have created for you.
 
-----Original Message-----

Well you're original message did not indicate that you had very little working
experience in Access so I assumed that you would be
familiar with these procedures.
Forms that are used to enter data in Access are
generally "bound" to a table, query,
or SQL statement. This is determined by the Record
Source property of the form when
looked at in design view. By binding the form in this manner, data changes made in
the form are automatically made in the underlying tables without you having to do
anything specific to make this happen.

If you bind your form to a query or SQL statement, these can include filter criteria
to limit the records that the form will display.
Therefore an impossible criteria
like WHERE 1=0 will always return zero rows and the form would be blank. You can
alternatively set the DataEntry property of a form to True and it will also open
blank for the purpose of entering new records. Perhaps that option would fulfill
your needs and it would be simpler to implement. The difference between using
DataEntry mode and using a zero-records RecordSet is
that the user can open a form in
DataEntry mode and then use the menus/toolbars
to "Remove All Filters". If they do
that then they will see all of the records displayed in the form. This is not
possible with a zero-records RecordSet.

If you choose to use a zero-record RecordSet the form will initially open blank.
After the user enters a record and advances to add a second, the first record will
still be available to them if they navigate backwards. If they entered 100 records
in a single session, they would be able to navigate to any of them. By issuing a
Requery command to the form after each insert, the previously entered records are
removed from view and the user will never have access to any record other than the
current "New" one they are entering. Again, perhaps
this exceeds your requirements.
To apply the impossible criteria, open your form in design view and find the
RecordSource property. This will either be the name of a table, the name of a query,
or an SQL statement. Regardless of which it is, you can click on the build [...]
button at the right of the property to bring up a query design tool for the RecordSet
and then just add the 1=0 criteria into the criteria section of an empty column.

To Apply the Requery command, go to the form's property sheet and look at the Events
tab. Find the event named "After Insert" and from the drop-down list, select "[Event
Procedure]". Then click on the build button [...] at the right. This will take you
to the code module window where you can enter...

Me.Requery

.... between the Sub and End Sub lines that Access will have created for you.


.
Thanks... This is perfect!!!
 
Back
Top