473,385 Members | 1,357 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Restricting A97 form to editing only?

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
5 1633
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: volume | last post by:
Restricting a windows textbox (edit item) to digits only. Is there a windows option, using .NET C#, to only allow a user to enter digits ONLY? If so, what is the flag or setting? If no, what is...
1
by: compl | last post by:
I have a database that I need to restrict the ability to edit one field based on another. The two fields are DOS (date) and Amount (currency). I only want the users to be able to edit the Amount...
8
by: sneddo | last post by:
Ok I am trying to do the above, I have got a script that will restrict the length but it requires the user to enter the field and hit a key, before it will work. This would normaly be find, but...
2
by: GANA1234 | last post by:
Hello all, I have a form with which has buttons for adding and editing . I want to restrict the users from editing other users records but all the users can see everyone else records . Also...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.