Restrict records in an Access Table

Status
This thread has been Locked and is not open to further replies. The original thread starter may use the Report button to request it be reopened but anyone else with a similar issue should start a New Thread. Watch our Welcome Guide to learn how to use this site.

Gurnerworld

Thread Starter
Joined
Dec 18, 2000
Messages
124
Hi,

I'm not that proficient in Access, so this might be a stupid question, but I'd appreciate some advice anyway.

Is it possible to limit the number of records in an Access table? I'm trying to create a standalone tool which only requires one record and am not sure how to go about it.

Any clues?
 

Anne Troy

Anne
Joined
Feb 14, 1999
Messages
11,751
Since it only requires one record and no changes will be made to it, does it make sense to hide it, Mikey? Just right-click it and hide it.
 

Gurnerworld

Thread Starter
Joined
Dec 18, 2000
Messages
124
Hey Dreamy,

Somewhat unavailable? Have I missed something?

Anyway, I want the user to be able to add their record, see their record and edit their record, I just don't want them to be able to add another.

Does that make sense?

M
x
 
Joined
Mar 12, 2001
Messages
912
Hi, mind if I add my three cents worth?

Off hand I don't know of a way to restrict the addition of records in a table but if you can restrict the user to data entry via a Form then you can set the Forms AllowAdditions property to No.
I don't know which version of Access you have, but this is the case in 2000. I think in earlier versions the property, which may need to be un-hidden, is DefaultEditing, which contains the option 'Can't Add Records' which allows editing.

Just a thought.
 

Gurnerworld

Thread Starter
Joined
Dec 18, 2000
Messages
124
Thanks for this Mike.

I need the user to use the form once to add the record, but after that, for them to only be able to edit it. I'm presuming that I could have the AllowAdditions property set to Yes initially, then have them press a button to get out which will then switch AllowAdditions to No.

Does that make sense?
 
Joined
Oct 13, 2000
Messages
941
You could do it that way, but it's a lot more complicated than just

- creating a "dummy" record in your table, and then

- setting Allow Additions to false on the form.

By "dummy" record I mean that you create one field not visible to the user (i.e. no controls on the form using that field as a control source), put some dummy value in that field, and then let the user fill in the rest. (All other record fields are left blank or at their default values.) There's no primary-key issue, because there's only one record. And then there's no button code/macro to write...
 

Gurnerworld

Thread Starter
Joined
Dec 18, 2000
Messages
124
Excellent one Downwitchyobadself - thanks.

Could you do me a favour and check my logic for me?

I want to produce a standalone application (.exe) which when they open it, a user will enter in some details. This will only be done once, and from that point forward, the application will update a number of calculated fields each time it is opened.

It just needs the one record (hence the question), although they can edit their original data at a later date if they choose to.

Does this make sense (or could you suggest a better way)?
 
Joined
Mar 12, 2001
Messages
912
Nice one downwitchyobadself!:cool:

Glad you posted before I got too far down the line trying to come up with a crazy button/macro solution - not that I would have succeeded mind you.

Simplest solutions are always the best.
LOL
 
Joined
Oct 13, 2000
Messages
941
Yes, I see what you're after. You'll have to write a little code to do it, though. Because what you're saying is like so:
Code:
'db opens up with AutoExec
If [myonerecordtable].[somefieldvalue] = False then
    'make me fill it in by opening the form
Else
   'open some other form, get on with life and general business
End if
This is not VBA, of course, not yet. But that's what you'd need. I'd put a Yes/No field in that table (could be your "dummy" field as well) called something like IsFilledOut, which should then be set to True once the user types his deets.

But: question: What kind of info are you storing? Is it about users? Because shouldn't it come from a central source? Or maybe not. Depends on your app. Let us know.
 

Gurnerworld

Thread Starter
Joined
Dec 18, 2000
Messages
124
Thanks Downwitchyobadself,

That makes sense.

Can I actually create a standalone, executable application in Access 2000? I've seen references to the ability to do it in Access 97, but warnings that it makes massive applications.

Would I be better off doing this in Visual Basic or something else?

The application itself is extremely simple and can be created in a spreasheet, I'm justy looking for a way to package it up and sell it. It needs about 5 fields filled in by a user and then produces about 20 calculations based on those fields which update each time it is opened.

Am I making sense?
 
Joined
Oct 13, 2000
Messages
941
With the Developer edition of MS Office, you should be able to build .exe files etc. It's really up to you; if you know VB (and have it) and see an easy road that way, I'd go for it. Of course, if you have Developer, and you're comfy in Access, it's relatively easy to make the app, even include a runtime version of Access for people who don't have it.

One thing is sure: as far as selling something is concerned, the faster and more compact it is, the better. And Access won't be the route for that, if all you're doing is a few calculations on a few inputs.

That's my 2 cents, anyway.
 
Status
This thread has been Locked and is not open to further replies. The original thread starter may use the Report button to request it be reopened but anyone else with a similar issue should start a New Thread. Watch our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top