SELECT INTO query

D

Drew

I am having a problem with an app that was built by someone else. The app
is for Events and it has 3 buttons that export certain data to different
Access mdbs. The query is as follows,

SELECT CliEventEntryFormQuery.RegNo, CliEventEntryFormQuery.CliEPI,
CliEventEntryFormQuery.CliLName, CliEventEntryFormQuery.CliFName,
CliEventEntryFormQuery.CliLivingArea, CliEventEntryFormQuery.CliActive,
CliEventEntryFormQuery.EventDate, CliEventEntryFormQuery.CliDOB,
CliEventEntryFormQuery.EventResEPI, CliEventEntryFormQuery.CliLivingUnit,
CliEventEntryFormQuery.Mobility, CliEventEntryFormQuery.FallPrecaution,
CliEventEntryFormQuery.BAR, CliEventEntryFormQuery.DRVDReport,
CliEventEntryFormQuery.Claims, CliEventEntryFormQuery.Litigations,
CliEventEntryFormQuery.RepeatFaller, CliEventEntryFormQuery.LevelOfRisk,
CliEventEntryFormQuery.[48HourReport], CliEventEntryFormQuery.Remarks,
CliEventEntryFormQuery.DiscoveryTime, CliEventEntryFormQuery.DiscoveryDate,
CliEventEntryFormQuery.AgencyCode, CliEventEntryFormQuery.EventClosed,
CliEventEntryFormQuery.EventAggressor,
CliEventEntryFormQuery.HurtByAggressor, CliEventEntryFormQuery.Comments,
CliEventEntryFormQuery.PlanOfCorrection,
CliEventEntryFormQuery.[Add'lInHouse],
CliEventEntryFormQuery.HospitializationRequired,
CliEventEntryFormQuery.RescueSquad,
CliEventEntryFormQuery.InfirmaryAdmission,
CliEventEntryFormQuery.EmergencyCenter, CliEventEntryFormQuery.DeathReview,
CliEventEntryFormQuery.[DGS/DRMNotified],
CliEventEntryFormQuery.RiskMgrNotified,
CliEventEntryFormQuery.MedAttnNeeded,
CliEventEntryFormQuery.EventSubcategory,
CliEventEntryFormQuery.EventSeverity,
CliEventEntryFormQuery.InjuredBodyPart,
CliEventEntryFormQuery.EventIllnessInjury,
CliEventEntryFormQuery.EventLocation, CliEventEntryFormQuery.EventBuilding,
CliEventEntryFormQuery.EventSituation, CliEventEntryFormQuery.EventEvent,
CliEventEntryFormQuery.EventTime INTO CliEventTable IN
'\\swvtc06\Clients\Events Unit1\ClientEventDataU1.mdb'
FROM CliEventEntryFormQuery
WHERE (((CliEventEntryFormQuery.CliLivingUnit)="1"));

There are 3 of these, the only difference being in the WHERE clause,
CliLivingUnit=1, CliLivingUnit=2, CliLivingUnit=3.

The query works by deleting the table in the mdb, recreating the table, then
exporting the data into the table. Both 1 and 2 work fine, but 3 has been
giving me problems. It will delete the table, but then it won't recreate
the table and export the data. Instead it gives me the following error,
"Record is deleted".

Does anyone have any ideas? Using Access 2002 (XP) on Windows XP SP2
machine. The path in the query is correct.

Thanks,
Drew
 
D

Douglas J. Steele

That query does not delete a table, so obviously there's more happening in
your application.

What's the VBA code that runs when you click on a button? Is it the same for
all buttons (except for a passed parameter), or is there different code
associated with each button? If it's different, what's the difference for
the 3rd case?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Drew said:
I am having a problem with an app that was built by someone else. The app
is for Events and it has 3 buttons that export certain data to different
Access mdbs. The query is as follows,

SELECT CliEventEntryFormQuery.RegNo, CliEventEntryFormQuery.CliEPI,
CliEventEntryFormQuery.CliLName, CliEventEntryFormQuery.CliFName,
CliEventEntryFormQuery.CliLivingArea, CliEventEntryFormQuery.CliActive,
CliEventEntryFormQuery.EventDate, CliEventEntryFormQuery.CliDOB,
CliEventEntryFormQuery.EventResEPI, CliEventEntryFormQuery.CliLivingUnit,
CliEventEntryFormQuery.Mobility, CliEventEntryFormQuery.FallPrecaution,
CliEventEntryFormQuery.BAR, CliEventEntryFormQuery.DRVDReport,
CliEventEntryFormQuery.Claims, CliEventEntryFormQuery.Litigations,
CliEventEntryFormQuery.RepeatFaller, CliEventEntryFormQuery.LevelOfRisk,
CliEventEntryFormQuery.[48HourReport], CliEventEntryFormQuery.Remarks,
CliEventEntryFormQuery.DiscoveryTime,
CliEventEntryFormQuery.DiscoveryDate, CliEventEntryFormQuery.AgencyCode,
CliEventEntryFormQuery.EventClosed, CliEventEntryFormQuery.EventAggressor,
CliEventEntryFormQuery.HurtByAggressor, CliEventEntryFormQuery.Comments,
CliEventEntryFormQuery.PlanOfCorrection,
CliEventEntryFormQuery.[Add'lInHouse],
CliEventEntryFormQuery.HospitializationRequired,
CliEventEntryFormQuery.RescueSquad,
CliEventEntryFormQuery.InfirmaryAdmission,
CliEventEntryFormQuery.EmergencyCenter,
CliEventEntryFormQuery.DeathReview,
CliEventEntryFormQuery.[DGS/DRMNotified],
CliEventEntryFormQuery.RiskMgrNotified,
CliEventEntryFormQuery.MedAttnNeeded,
CliEventEntryFormQuery.EventSubcategory,
CliEventEntryFormQuery.EventSeverity,
CliEventEntryFormQuery.InjuredBodyPart,
CliEventEntryFormQuery.EventIllnessInjury,
CliEventEntryFormQuery.EventLocation,
CliEventEntryFormQuery.EventBuilding,
CliEventEntryFormQuery.EventSituation, CliEventEntryFormQuery.EventEvent,
CliEventEntryFormQuery.EventTime INTO CliEventTable IN
'\\swvtc06\Clients\Events Unit1\ClientEventDataU1.mdb'
FROM CliEventEntryFormQuery
WHERE (((CliEventEntryFormQuery.CliLivingUnit)="1"));

There are 3 of these, the only difference being in the WHERE clause,
CliLivingUnit=1, CliLivingUnit=2, CliLivingUnit=3.

The query works by deleting the table in the mdb, recreating the table,
then exporting the data into the table. Both 1 and 2 work fine, but 3 has
been giving me problems. It will delete the table, but then it won't
recreate the table and export the data. Instead it gives me the following
error, "Record is deleted".

Does anyone have any ideas? Using Access 2002 (XP) on Windows XP SP2
machine. The path in the query is correct.

Thanks,
Drew
 
D

Drew

I found out what it was... I just had to compact and repair the database.

Thanks for your response.
Drew

Douglas J. Steele said:
That query does not delete a table, so obviously there's more happening in
your application.

What's the VBA code that runs when you click on a button? Is it the same
for all buttons (except for a passed parameter), or is there different
code associated with each button? If it's different, what's the difference
for the 3rd case?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Drew said:
I am having a problem with an app that was built by someone else. The app
is for Events and it has 3 buttons that export certain data to different
Access mdbs. The query is as follows,

SELECT CliEventEntryFormQuery.RegNo, CliEventEntryFormQuery.CliEPI,
CliEventEntryFormQuery.CliLName, CliEventEntryFormQuery.CliFName,
CliEventEntryFormQuery.CliLivingArea, CliEventEntryFormQuery.CliActive,
CliEventEntryFormQuery.EventDate, CliEventEntryFormQuery.CliDOB,
CliEventEntryFormQuery.EventResEPI, CliEventEntryFormQuery.CliLivingUnit,
CliEventEntryFormQuery.Mobility, CliEventEntryFormQuery.FallPrecaution,
CliEventEntryFormQuery.BAR, CliEventEntryFormQuery.DRVDReport,
CliEventEntryFormQuery.Claims, CliEventEntryFormQuery.Litigations,
CliEventEntryFormQuery.RepeatFaller, CliEventEntryFormQuery.LevelOfRisk,
CliEventEntryFormQuery.[48HourReport], CliEventEntryFormQuery.Remarks,
CliEventEntryFormQuery.DiscoveryTime,
CliEventEntryFormQuery.DiscoveryDate, CliEventEntryFormQuery.AgencyCode,
CliEventEntryFormQuery.EventClosed,
CliEventEntryFormQuery.EventAggressor,
CliEventEntryFormQuery.HurtByAggressor, CliEventEntryFormQuery.Comments,
CliEventEntryFormQuery.PlanOfCorrection,
CliEventEntryFormQuery.[Add'lInHouse],
CliEventEntryFormQuery.HospitializationRequired,
CliEventEntryFormQuery.RescueSquad,
CliEventEntryFormQuery.InfirmaryAdmission,
CliEventEntryFormQuery.EmergencyCenter,
CliEventEntryFormQuery.DeathReview,
CliEventEntryFormQuery.[DGS/DRMNotified],
CliEventEntryFormQuery.RiskMgrNotified,
CliEventEntryFormQuery.MedAttnNeeded,
CliEventEntryFormQuery.EventSubcategory,
CliEventEntryFormQuery.EventSeverity,
CliEventEntryFormQuery.InjuredBodyPart,
CliEventEntryFormQuery.EventIllnessInjury,
CliEventEntryFormQuery.EventLocation,
CliEventEntryFormQuery.EventBuilding,
CliEventEntryFormQuery.EventSituation, CliEventEntryFormQuery.EventEvent,
CliEventEntryFormQuery.EventTime INTO CliEventTable IN
'\\swvtc06\Clients\Events Unit1\ClientEventDataU1.mdb'
FROM CliEventEntryFormQuery
WHERE (((CliEventEntryFormQuery.CliLivingUnit)="1"));

There are 3 of these, the only difference being in the WHERE clause,
CliLivingUnit=1, CliLivingUnit=2, CliLivingUnit=3.

The query works by deleting the table in the mdb, recreating the table,
then exporting the data into the table. Both 1 and 2 work fine, but 3
has been giving me problems. It will delete the table, but then it won't
recreate the table and export the data. Instead it gives me the
following error, "Record is deleted".

Does anyone have any ideas? Using Access 2002 (XP) on Windows XP SP2
machine. The path in the query is correct.

Thanks,
Drew
 
Top