Random Automation Errors with Dim variable 
Author Message
 Random Automation Errors with Dim variable

2 days ago a made a bunch of forms that have subfoms with unbound controls
based on queries referring to contols on the parent. They worked fine when
I left for the day. Now I'm suddenly getting "Complie Error: Automation
Error". The help is no help and I wasn't even aware I was using automation
for anything. Here is the code:

Sub IDB_ASSIGN_Click()
On Error GoTo Err_IDB_ASSIGN_Click

Dim dbs As Database, rst As Recordset  '////////////////////////THIS IS
WHERE THE ERROR OCCURS
    Set dbs = CurrentDb()
    Set rst = dbs.OpenRecordset("Attributes-WrapObjParts")
    rst.AddNew
    rst![Wrap Object ID] = Parent![Wrap Object ID]
    rst![Standard Part ID] = Me![IDL_AVAILABLE]
    rst.Update
    rst.Close
    Me![IDL_ASSIGNED].Requery

Exit_IDB_ASSIGN_Click:
    Exit Sub

Err_IDB_ASSIGN_Click:
    MsgBox Err.Description
    Resume Exit_IDB_ASSIGN_Click

End Sub

Any Clues? Am I missing something obvious. Have I had too much Diet Coke?

Please Help
Alley



Thu, 21 Oct 1999 03:00:00 GMT  
 Random Automation Errors with Dim variable

Quote:

> 2 days ago a made a bunch of forms that have subfoms with unbound controls
> based on queries referring to contols on the parent. They worked fine when
> I left for the day. Now I'm suddenly getting "Complie Error: Automation
> Error". The help is no help and I wasn't even aware I was using automation
> for anything. Here is the code:

> Sub IDB_ASSIGN_Click()
> On Error GoTo Err_IDB_ASSIGN_Click

> Dim dbs As Database, rst As Recordset  '////////////////////////THIS IS
> WHERE THE ERROR OCCURS
>     Set dbs = CurrentDb()
>     Set rst = dbs.OpenRecordset("Attributes-WrapObjParts")
>     rst.AddNew
>     rst![Wrap Object ID] = Parent![Wrap Object ID]
>     rst![Standard Part ID] = Me![IDL_AVAILABLE]
>     rst.Update
>     rst.Close
>     Me![IDL_ASSIGNED].Requery

> Exit_IDB_ASSIGN_Click:
>     Exit Sub

> Err_IDB_ASSIGN_Click:
>     MsgBox Err.Description
>     Resume Exit_IDB_ASSIGN_Click

> End Sub

> Any Clues? Am I missing something obvious. Have I had too much Diet Coke?

> Please Help
> Alley

This a REALLY annoying problem that I've had twice now.  The problem is
100% irrational. DAO object types should not suddenly become
unrecognized by the compiler.  The only solution that worked for me was
to create a new database and import all the objects from the old
database.  Whatever corruption was causing the anomolous problem did not
reside in the object definitions, because my code compiled successfully
after that.

Try reinstalling Access if that doesn't work.

-Brandon Fogel



Fri, 22 Oct 1999 03:00:00 GMT  
 Random Automation Errors with Dim variable

This maybe way of the mark but from your indication of where the error
occurs. I think access is pretty funny about declaring variables. Instead
of your line, try

Dim dbs as Database
Dim rst as recordset

ie a seperate DIM statement for dbs and rst, and on a different line.

Scott.



Quote:
> 2 days ago a made a bunch of forms that have subfoms with unbound
controls
> based on queries referring to contols on the parent. They worked fine
when
> I left for the day. Now I'm suddenly getting "Complie Error: Automation
> Error". The help is no help and I wasn't even aware I was using
automation
> for anything. Here is the code:

> Sub IDB_ASSIGN_Click()
> On Error GoTo Err_IDB_ASSIGN_Click

> Dim dbs As Database, rst As Recordset  '////////////////////////THIS IS
> WHERE THE ERROR OCCURS
>     Set dbs = CurrentDb()



Mon, 01 Nov 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. dynamically dim a variable ie dim "variable"&n

2. automation error - dim mydb as database

3. Random automation error -2147417848

4. Random automation error -2147417848

5. Random Automation error -2147417848

6. Dim x As TextBox - variable not set error

7. Random variable without choosing same variable twice?

8. Dim and random files

9. Error 458: Variable uses an Automation type not supported in Visual Basic

10. Error when creating dll: variable uses an automation type not supported in visual basic

11. Error 458 Automation uses a variable type not defined in Visual Basic

12. ADODB Error: Variable uses an Automation type not supported in Visual Basic

 

 
Powered by phpBB® Forum Software