Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Allowing only one record per table 1

Status
Not open for further replies.

8441

Technical User
May 9, 2001
54
GB
Please help!!

Is there a way of setting a table so that it only holds one record.

I have a table holding three fields, County, Division and Event. The plan is for the user to configure these fields on initially opening the application and these appear throughout the program.

When the user wants a fresh database the click on a button which then clears these fields and allows them to enter new details, but the table only ever holds one record.

Many thanks for your help.
craig
 
A different approach is to have a table that holds settings for your db. I normally call it tblSettings and have these fields in it:

SettingName (text) - primary key, the name of the setting (IE: Country)
SettingValue (text) - the value of that setting (IE: United States)

Then you can place your setting and lookup the value throughout your db. Now you've got one table holding all the settings and you can write functions to look them up for you (IE: DLookup). This way you're not littering your db with tables that are only storing 1 record.

HTH Joe Miller
joe.miller@flotech.net
 
The best way to do this is to control access to the table through a form whose allow additions and allow deletions properties are set to No(after have already created a "dummy" record of course). Then any time they want to change this "master" information they must go through your protected form.
 
Thanks for this. Jerry, This is exactly what I wanted to do, I couldn't work out how to do it.

Many Thanks both of you.
 
You can also delete the old record first before adding a new record into the table.
 
bigjohn3k, you can't do that if you only allow modification of the record through a form whose Allow Additions and Allow Deletions properties are set to No.
 
Oops, sorry I did not read your previous response prior to my posting. This could be an alternative if you did not set up a restricted form.
 
The way to do this:
Set a primary key, ie RecordID
Set Validation rule = 1
add one record, RecordID= 1.
No other records can be added
--Jim
 
Thanks to everyone who has replied. I now have this sorted.

Craig
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top