InsertRecordFromNetworkedPC()

F

Frank

Hi all,

I'm new to Access and Visual Basic. I've built the tables, queries, forms
and reports and I'm ready to write my first code (module?). I know I'm
basically asking someone else to write my code BUT... if anybody will "hold
my hand" here... I learn very quickly by example.

To get me moving quickly I need 3 procedures (or whatever they are called
in Access) AND I need to know "where" to locate them. I'm using a separate
message post for each request for procedure help.

"yisturday i didint no hou ta spel computir programar, taday i r wun".


THANX for your time... Frank


---------------------------------------------------
3 Computers (networked, peer-to-peer)
WindowsXP Pro SP3 (NOT using "simple" file sharing)
Access 2003 SP3
---------------------------------------------------

PROC #2 - InsertRecordFromNetworkedPC() ===========

All my "top tier" tables have unique Primary Keys (integer). ALL
"important" relationships have Referential Integrity (don't know if I should
have done that). I don't want to use AutoNumber. I want to track "top tier"
primary keys and be able to "reuse" previously deleted ones FIRST (BEFORE
assigning a

virgin). I have created a table to track the unused(true/false) record
numbers.

1) Contain current "best practice" for error handling and debugging

2) Be ACCESSIBLE from anywhere within the current Access environment

3) IF the user just pressed the <Shift>+<Ctrl>+<Insert> hotkey combination
THEN

4) IF current focus is an "editable" table THEN

5) IF the table has a "supporting" ReuseableKeyTable THEN

6) Determine next available key is ("reusable" or "virgin") THEN

7) Perform the appropriate record lock(s) AND insert new record

8) UNLOCK relevant records

9) ELSE MESSAGE("can't use that HotKey here")
 
T

Tony Toews [MVP]

Frank said:
All my "top tier" tables have unique Primary Keys (integer). ALL
"important" relationships have Referential Integrity (don't know if I should
have done that). I don't want to use AutoNumber.

Why don't you want to use Autonumber? It saves a *lot* of hassles.
I want to track "top tier"
primary keys and be able to "reuse" previously deleted ones FIRST (BEFORE
assigning a >virgin). I have created a table to track the unused(true/false) record
numbers.

Who cares what those numbers are? The user should never see them.
And you as the developer really don't care either other than that they
exist and are unique. Use autonumbers.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
D

Dirk Goldgar

Tony Toews said:
Why don't you want to use Autonumber? It saves a *lot* of hassles.


Who cares what those numbers are? The user should never see them.
And you as the developer really don't care either other than that they
exist and are unique. Use autonumbers.


But *if* Frank is not using surrogate keys, then the key values may well
have a significance other than uniqueness, in which case it's likely that
the user *should* see the keys. It seems to me you're jumping to the
conclusion that Frank ought to be using autonumbers, and you may be right,
but without knowing Frank's application it's awfully early to draw that
conclusion.
 
T

Tony Toews [MVP]

Dirk Goldgar said:
But *if* Frank is not using surrogate keys, then the key values may well
have a significance other than uniqueness, in which case it's likely that
the user *should* see the keys. It seems to me you're jumping to the
conclusion that Frank ought to be using autonumbers, and you may be right,
but without knowing Frank's application it's awfully early to draw that
conclusion.

Yes, I am jumping to that conclusion. Based on his use of Integer and
ascending values.

Hmm, and using Integer fields will limit him to 32,768 records in
those tables.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
F

Frank

Hi Dirk,

I know it as a "short" integer (32k limit from Paradox).
I notice his stated desire of avoiding gaps in the number sequence, which
rules out the use of autonumbers. It's worth inquiring why he has that
particular requirement.
<<
It's parting of my old Italian upbring... don't waste anything.
<HahaHahaHaha> hows that for a tech savvy answer? Also (that strategy) has
saved me on physical document storage costs.

THANX for your time... Frank
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top