By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,688 Members | 1,897 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,688 IT Pros & Developers. It's quick & easy.

Restricting A97 form to editing only?

P: n/a
MLH
I have a form based on a table that is opened this way...

DoCmd.OpenForm "frmAdminSetupInfo", , , , A_EDIT

It was my intention that the form allow the user to edit table
data - not add records. The table contains a single record only.
I don't want more records be added to the table.

When frmAdminSetupInfo opens, all one has to do to go to
a newrec (empty new record) is press PGDN or hold down
the TAB key until focus reaches last tabbable control then
TABs its way on to the newrec. How can I accomplish what
I'm seeking here?
Nov 13 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
MLH wrote:
I have a form based on a table that is opened this way...

DoCmd.OpenForm "frmAdminSetupInfo", , , , A_EDIT

It was my intention that the form allow the user to edit table
data - not add records. The table contains a single record only.
I don't want more records be added to the table.

When frmAdminSetupInfo opens, all one has to do to go to
a newrec (empty new record) is press PGDN or hold down
the TAB key until focus reaches last tabbable control then
TABs its way on to the newrec. How can I accomplish what
I'm seeking here?


Set the AllowAdditions property to No.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2

P: n/a
Some options:

1. Set the form's AllowAdditions property to No.

2. Cancel the form's BeforeInsert event.

3. Use a Number (not AutoNumber) field as the table's primary key. Set the
Default Value of this field to:
1
Don't expose this field in the form. After one record is added another
cannot be. If you want to go over the top, you could also set the Validation
rule on the field to:
=1

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"MLH" <CR**@NorthState.net> wrote in message
news:7l********************************@4ax.com...
I have a form based on a table that is opened this way...

DoCmd.OpenForm "frmAdminSetupInfo", , , , A_EDIT

It was my intention that the form allow the user to edit table
data - not add records. The table contains a single record only.
I don't want more records be added to the table.

When frmAdminSetupInfo opens, all one has to do to go to
a newrec (empty new record) is press PGDN or hold down
the TAB key until focus reaches last tabbable control then
TABs its way on to the newrec. How can I accomplish what
I'm seeking here?

Nov 13 '05 #3

P: n/a
MLH wrote:
When frmAdminSetupInfo opens, all one has to do to go to
a newrec (empty new record) is press PGDN or hold down
the TAB key until focus reaches last tabbable control then
TABs its way on to the newrec. How can I accomplish what
I'm seeking here?


In addition to what Rick and Allen mention, you can set the "cycle
records" form property (on the other tab) so that tabbing will only go
through the displayed record.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #4

P: n/a
MLH
Thx, guys. All suggestions worked fine. I keep getting caught up
in old Access 2.0 thinking. 97 is a teeny bit different.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

In addition to what Rick and Allen mention, you can set the "cycle
records" form property (on the other tab) so that tabbing will only go
through the displayed record.


Nov 13 '05 #5

P: n/a
Allen Browne wrote:
Some options:

1. Set the form's AllowAdditions property to No.

2. Cancel the form's BeforeInsert event.

3. Use a Number (not AutoNumber) field as the table's primary key. Set the
Default Value of this field to:
1
Don't expose this field in the form. After one record is added another
cannot be. If you want to go over the top, you could also set the Validation
rule on the field to:
=1


Myself, I'd do two out of the 3 and always No.3. It's all very well
preventing something on the form in a user freindly manner but if the
application will break with 2 records in that table then a table level
constraint is the way to go. This prevents a second record being added
by other means as well.

Nov 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.