Splitting Database

L

Lavatress

On my main database called, DataEntry.mdb, I have a switchboard. On the
switchboard I have a button called, "DELETE DATA DAILY". When it is
pressed, it deletes the data from my main table called, "TEST". I also have
another button called, "UPDATE AUDIT DAILY", that has some VBA code that
transfer data from my "TEST" table in my main database to another table
called, "Audit Data", which is located in other database called ,"AUDIT.mdb".
My problem is: before, I splitted my main Database, the "DELETE DATA DAILY"
button was working fine. It was deleting the data from my main table "TEST".
However, when I splitted my main database, I added the backend to the
network, and when I pressed the "DELETE DATA DAILY" button, it deleted the
data from my "Audit Data" table b/c it linked the two tables together. My
question is: How to have the split database feature w/o linking the "TEST"
table and the "Audit Data" table ? My objective is to improve the performance
of my database and eliminate it from crashing.
 
D

Douglas J. Steele

Sorry, this doesn't make any sense to me. Splitting a database doesn't merge
the data from separate tables. If your original action was deleting data
from a table called Test before, it's still going to be deleting from Test,
not from someother table. This, of course, assumes that you were running a
Delete query. If you aren't using a Delete query, how are you deleting the
data?
 
L

Lavatress

I may not have explain myself sufficently. I am using a delete query. I am
also using code to transfer data from my main database to another. Here is
the code that I have behind my "Update AUDIT DAILY" button that is located on
my main database:

Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim file As String
Dim mydate As String
Dim edit As String
mydate = #9/1/2006#
mydate = DateAdd("d", 0, Date)

Set db = CurrentDb
Set rst = db.OpenRecordset("TEST")
file = "I:\Susdata\BRCC\BRCC\DATA ENTRY\AUDIT.mdb"
edit = MsgBox("Are you sure you want update the AUDIT database for " &
mydate, vbCritical + vbYesNo, "Save Database")
If edit = 6 Then
Me.AllowEdits = True
DoCmd.TransferDatabase acExport, "Microsoft Access", file, acTable, "TEST",
"Audit Data", structureonly:=False
MsgBox "AUDIT Database has been updated", , "Updated"
Else: MsgBox "Your request has been denied. No action was taken", , "Request
Canceled"
End If
End Sub

However, as I mention before when I splitted my main database it linked the
two tables together. So, whatever I did in my "TEST" table it repeated it in
my "Audit Data" table, and I didn't want that to happen. When I pressed the
delete query button it deleted information from both tables. The reason I
know they were linked b/c the Audit Data table had the (->) before it, and
(->) was not there before I splitted my main database. Can you tell me what
I am doing wrong?
 
D

Douglas J. Steele

Are you saying that Test used to be in a different database than Audit Data,
and now they're in the same database? You don't need to use
TransferDatabase: a simply query to transfer from one to the other should be
sufficient.
 
L

Lavatress

Test has always been in a different database from Audit Data. They are not
in the same database. However, they are now linked together since I splitted
the Test database.
 

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

Top