Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 18th, 2007, 03:04 AM
Authorized User
 
Join Date: Nov 2005
Location: Lusaka, Lusaka, Zambia.
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default Updating a database with new records modified

Thank you mmcdonal for the information towards the subject. May I know a few things. I have three tables lets say Table A with fields;DonorID,Name, ************,Address( primary Key DonorID-datatype "text") , table B with fields; DonorID,UnitNumber,(Primary Key UnitNumber-datatype "text"), C with fields;SerialID,UnitNumber (primary key SerialID-datatype "Autonumber")
Table A is linked to Table B by "DonorID"
table B is Linked to table C by "UnitNumber"
This means that for every record to be complete data must be entered in the three tables. therefore, on downloading I need to down data from the three linked tables.

1. How do I create the Superkey in order to download data from say a laptop computer to update the main database on the main computer or what is the best way to do it?
2. How do I automate this procedure?


Bmulenga
__________________
Bmulenga
Reply With Quote
  #2 (permalink)  
Old January 18th, 2007, 08:39 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

You would either need to create a field in each table that is a concatenation of several fields to be your superkey (set to be indexed, duplicates No) or generate the key at runtime as part of your code. It might be easier to store the data, if the size of your database allows this.

In your table, create a field to hold this data. I am troubled that the DonorID is a text field. Do you want to make this an autonumber field? I might also add a DateCreated field and set the default to Date().

Anyway, on your data entry form, put the new field (Call it SupKeyA)and do this code on the Before Insert event (assuming you change DonorID to an autonumber data type):

Dim sKey as String

sKey = CStr(Me.DonorID) & "-" & Me.Name & "-" & CStr(Me.DateCreated)

Me.SupKeyA = sKey

This will add a unique superkey to the record. If you anticipate perhaps changing this person's name sometime in the future, you can also add this code to the Before Update event of the form.

Add this field (Maybe SupKeyA, SupKeyB, SupKeyC) and code to all your data entry forms.

How you update the main database depends on how the users are connecting, or if you are transferring the database file using a memory key, etc. Can you tell me more about how they are doing this?

The idea is that now you can loop through the central TableA, and compare each SupKeyA in the remote database to the SupKeyA field in the main table. If none are found, then copy it over. Then move on to TableB, etc.



mmcdonal
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Updating a database with new records modified cont bright_mulenga Access 0 January 18th, 2007 10:59 AM
Updating a database with new records bright_mulenga Access 1 January 17th, 2007 11:53 AM
problem in updating records & finding records naveed77 VB Databases Basics 1 January 16th, 2007 12:12 PM
problem in updating records & finding records naveed77 VB How-To 1 January 16th, 2007 12:10 PM
Updating database records in ASP/ADO aismail3 Classic ASP Databases 5 September 16th, 2004 11:10 PM



All times are GMT -4. The time now is 03:17 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.