dbTalk Databases Forums  

One Record Table

comp.databases.ms-access comp.databases.ms-access


Discuss One Record Table in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
JackonLI
 
Posts: n/a

Default One Record Table - 03-31-2009 , 07:08 PM






I am using Access 2007 and I just can't figure out how to create a one
record table. Could someone help me out?

Thank you.

Reply With Quote
  #2  
Old   
Salad
 
Posts: n/a

Default Re: One Record Table - 03-31-2009 , 10:10 PM






JackonLI wrote:

Quote:
I am using Access 2007 and I just can't figure out how to create a one
record table. Could someone help me out?

Thank you.
This is untested....
If I were using a form to enter data, I might have something like
Me.AllowAdditions = (Me.Recordsetclone.RecordCount = 0)
in the OnCurrent event. Maybe
Me.AllowAdditions = False
in the AfterUpdate event of the form.

If you are entering data directly from a table or query, I see nothing
to stop a user from entering more than one record. There's no checks,
not validation, nothing.



Reply With Quote
  #3  
Old   
Tomahawk Lady
 
Posts: n/a

Default Re: One Record Table - 04-01-2009 , 07:28 AM



On Mar 31, 8:08*pm, JackonLI wrote:
Quote:
I am using Access 2007 and I just can't figure out how to create a one
record table. *Could someone help me out?

Thank you.
Just a clarification: Do you mean that you want the table to have
ONLY ONE record? Someone smarter than me has to answer how to limit a
table to one record. I pose this clarification because I can't
imagine why you're having trouble putting one record in a table.


Reply With Quote
  #4  
Old   
Arno R
 
Posts: n/a

Default Re: One Record Table - 04-01-2009 , 10:34 AM




<JackonLI> schreef in bericht
news:fkb5t4pu17i6cm9ld2qoqi2pmk209i41qd (AT) 4ax (DOT) com...
Quote:
I am using Access 2007 and I just can't figure out how to create a one
record table. Could someone help me out?

Thank you.
Create an indexed Field called ID or even make this field the prime key.
Create the record and set the value to 1.
Set as the validation rule for the field =1

==> No more records are possible.


HTH
Arno R




Reply With Quote
  #5  
Old   
Sky
 
Posts: n/a

Default Re: One Record Table - 04-01-2009 , 10:38 AM



Create a Boolean Yes/No field with a unique index. (It could be the primary
key field.) Set the field Validation Rule so that it must be True, or it is
not accepted. Normally you would not display this special field to the user
form, and you would pre-create the single record. Your form would allow the
user to edit the other fields but not delete the record.

You can also enforce non-deletion in the database by adding an enforced
relationship to a hidden child table (or to itself) with no cascading
deletes permitted. But it is easier to just do it in the form, if you are
not worried about external user queries deleting the record.

- Steve

<JackonLI> wrote

Quote:
I am using Access 2007 and I just can't figure out how to create a one
record table. Could someone help me out?

Thank you.



Reply With Quote
  #6  
Old   
Benny Andersen
 
Posts: n/a

Default Re: One Record Table - 04-01-2009 , 10:52 AM



On 1 Apr., 02:08, JackonLI wrote:
Quote:
I am using Access 2007 and I just can't figure out how to create a one
record table. Could someone help me out?

Thank you.
Make it a query:

select val1 as fname1, val2 as fname2,.....

If you need the change values in running code, you could make a sub
that alters through querydef object.
--
Benny


Reply With Quote
  #7  
Old   
JackonLI
 
Posts: n/a

Default Re: One Record Table - Thank You - 04-01-2009 , 09:51 PM



Thank you all for your responses. I wound up creating a sub form set
to only allow edits. Then referenced to sub form to get the value.

Thanks again

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.