Need help with Access 2000

R

rob muzzy

Hi,
I am running MS Access 2000 (9.0.2720) and I have created the
following vb code in the background.

Private Sub Form_Load()


On Error Resume Next
DoCmd.DeleteObject acTable, ("tblEmployeeData")
DoCmd.DeleteObject acTable, ("tblLaborticketData")
'DoCmd.DeleteObject acTable, ("tblPartFamilyTotals")
'DoCmd.DeleteObject acTable, ("tblOpenFamilyValue")
On Error GoTo 0

DoCmd.OpenQuery ("qryMakeTblLaborticketData")
DoCmd.OpenQuery ("qryMakeTblEmployeeData")
DoCmd.OpenQuery ("qryNewEmployees")

DoCmd.Quit acQuitSaveAll

End Sub

when i compile and debug it works fine but when i click on the file to
run on load with form 1 as the start point i get "the expression on
load you entered as the event property setting produced the following
error. Object or class does not support the set of events."

can someone assist me in getting rid of this error?


thanks

Rob
 
A

Allen Browne

What are you actually trying to achieve here, Rob?

There are several things that could cause this error, such as bad
references, inadequate permissions, an ActiveX control, an error in VBA
code, etc etc. If you open the code window (Ctrl+G) and choose Compile in
the Debug menu, it may take you to some of the problems.

But it's very unusal to delete the actual tables and create them from
scratch. This would mean you don't have relationshps between the tables, you
are not able to set important field properties (such as AllowZeroLength) or
table properties (such as SubDatasheetName.) You also have no idea whether
it actually succeeded or not (since you just resume after any error), so you
may or may not be working with th real data. Finally, you quit while loading
the form, so I have no idea where this was meant to go.

If you have set up tables and relationships correctly, there may be a case
for deleting the data rather than destroying the tables. But even that
sounds odd unless this is purely an exercise.
 
R

rob muzzy

What are you actually trying to achieve here, Rob?

There are several things that could cause this error, such as bad
references, inadequate permissions, an ActiveX control, an error in VBA
code, etc etc. If you open the code window (Ctrl+G) and choose Compile in
the Debug menu, it may take you to some of the problems.

But it's very unusal to delete the actual tables and create them from
scratch. This would mean you don't have relationshps between the tables, you
are not able to set important field properties (such as AllowZeroLength) or
table properties (such as SubDatasheetName.) You also have no idea whether
it actually succeeded or not (since you just resume after any error), so you
may or may not be working with th real data. Finally, you quit while loading
the form, so I have no idea where this was meant to go.

If you have set up tables and relationships correctly, there may be a case
for deleting the data rather than destroying the tables. But even that
sounds odd unless this is purely an exercise.

--
Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.













- Show quoted text -

Well the three queries
DoCmd.OpenQuery ("qryMakeTblLaborticketData")
DoCmd.OpenQuery ("qryMakeTblEmployeeData")
DoCmd.OpenQuery ("qryNewEmployees")

are append queries so they over write the tables that were being
deleted so even if I remove the delete commands it still blows up.
 
D

Douglas J. Steele

Sounds as though they may be Make Table queries, not Append queries.



--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


- Show quoted text -

Well the three queries
DoCmd.OpenQuery ("qryMakeTblLaborticketData")
DoCmd.OpenQuery ("qryMakeTblEmployeeData")
DoCmd.OpenQuery ("qryNewEmployees")

are append queries so they over write the tables that were being
deleted so even if I remove the delete commands it still blows up.
 

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