Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Database Design / December 2004

Tip: Looking for answers? Try searching our database.

Acc97: Combining unique's

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
noodnutt - 17 Dec 2004 17:03 GMT
G'day ppl,

Here's my dilemma, the db is for a boarding kennel.

I am trying to combine the owners uniqueID with each of their animals e.g

Client1 has 2 dogs, so in order to identify their dogs, I need something
like 1:1, 1:2 etc

Client69 has 12 dogs, eg
69:1 thru to 69:12

this way each animal will be tied directly to it's owner in a round-about
way, question is, how can I automate it so that when I come to entering the
animals details, this number will generate.

P.S. I already pass the owners ID automatically when the animal form opens

TIA

Mark
Tim Ferguson - 17 Dec 2004 19:46 GMT
> I am trying to combine the owners uniqueID with each of their animals e.g
>
> Client1 has 2 dogs, so in order to identify their dogs, I need something
> like 1:1, 1:2 etc

Try googling for Access Custom Autonumbers.

The method is to have two separate fields called, say, OwnerID and
DogNumber. You can find the next vacant dognumber by calling

 DMax("DogNumber", "Dogs", "OwnerID=27")

This will return the largest-so-far for this particular owner, or else a
Null if there are no dogs registered to him or her. You can add 1 to the
number in order to get the next one. You have restrict all data entry to a
form, because there is no way to get code to run if a dog is added using
VBA, Excel, querydef, etc.

I would be a little suspicious of the method, though. What happens when Reg
passes or sells his dog to Wendy - does the dog change from 23:2 to 17:12?
What happens to all the dependent tables with Foreign Key values pointed at
the old dog number? Still, you know your business rules!

All the best

Tim F
noodnutt - 19 Dec 2004 10:47 GMT
Thx heaps for your thoughts Tim.

With regard to changing ownership, that won't be an issue, as this DB only
relates to clients boarding their animals whilst they are away eg holidays
etc... the DB is still a work in progress, and will take a while as I am
nursing a broken arm.

best wishes for the upcoming holiday season.

regards

Mark.
Tim Ferguson - 19 Dec 2004 19:37 GMT
> the DB is still a work in progress, and will take a while as I am
> nursing a broken arm.

Nah.. only takes one hand to type! :-)

Hope you get better soon. Have a good Christmas.

Tim F
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.