Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 10-13-2018, 03:14 AM   #1
SjCc
Newly Registered User
 
Join Date: Oct 2017
Posts: 35
Thanks: 19
Thanked 0 Times in 0 Posts
SjCc is on a distinguished road
Class error 430

hi using this on a form on load event it poping error class does not support ... interface.. else on another pc with same os is running fine with no error.. the code is below


Code:
Option Compare Database

Public Function LogIN()
Dim TempID As String
Dim TempID2 As Long
TempID = UserOnName
TempID2 = UserOnID
Dim rs As ADODB.Recordset
Dim cmd As ADODB.Command

Set rs = New ADODB.Recordset
Set cmd = New ADODB.Command

cmd.ActiveConnection = CurrentProject.Connection

cmd.CommandText = "Select UserName, AccessLevel, deactive " _
                & "From tblEmployees " _
                & "Where UserName = '" & TempID & "'"
                
cmd.Execute
    rs.Open cmd, , adOpenKeyset, adLockOptimistic
    If rs.EOF = True Then GoTo KL
    'rs.MoveFirst
    'Do Until rs.EOF = True
       ' If rs.Fields(0) = TempID Then
        If rs.Fields(2) = -1 Then
            MsgBox "This Employee has been deactiveated from this utility, please contact the administrator", vbCritical
            DoCmd.Quit
        Else 'End If
            DoCmd.OpenForm "frmreports"
            rs.Close
            GoTo vt
        End If
      '  rs.MoveNext
   ' Loop
KL:
        rs.Close
        MsgBox "Authorized Personal Only, please contact a system administrator to use this utility.", vbCritical
        cmd.CommandText = "SELECT * FROM tblLogReport "
        cmd.Execute
        rs.Open cmd, , adOpenKeyset, adLockOptimistic
        rs.AddNew
        rs.Fields(0) = TempID 'fOSUserName
        rs.Fields(1) = Date
        rs.Fields(2) = Time
        rs.Fields(3) = "Attempted LogIN, Invalid User"
        rs.Fields(4) = TempID2
        rs.Update
        rs.Close
        DoCmd.Quit
        
        
vt:
cmd.CommandText = "SELECT * FROM tblLogReport "
cmd.Execute
    rs.Open cmd, , adOpenKeyset, adLockOptimistic
    rs.AddNew
    rs.Fields(0) = TempID 'fOSUserName
    rs.Fields(1) = Date
    rs.Fields(2) = Time
    rs.Fields(3) = "LogIN"
    rs.Fields(4) = TempID2
    rs.Update
    rs.Close
    
cmd.CommandText = "Select * FROM tblStartTime " _
                & "WHERE EmpLogin = '" & TempID & "' AND StartDate = #" & Date & "#"
cmd.Execute
rs.Open cmd, , adOpenKeyset, adLockOptimistic
    If rs.EOF = True Then
        rs.AddNew
        rs.Fields(0) = TempID
        rs.Fields(1) = Date
        rs.Fields(2) = Time
        
        rs.Update
        rs.Close
    End If
Set rs = Nothing
Set cmd = Nothing

End Function


Last edited by Uncle Gizmo; 10-13-2018 at 07:04 AM. Reason: added code Tags
SjCc is offline   Reply With Quote
Old 10-13-2018, 03:19 AM   #2
Uncle Gizmo
Nifty Access Guy
 
Uncle Gizmo's Avatar
 
Join Date: Jul 2003
Location: Newbury Berks UK
Posts: 9,458
Thanks: 358
Thanked 773 Times in 738 Posts
Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough
Send a message via Skype™ to Uncle Gizmo
Re: Class error 430

The first thing to check, have you got a reference to ADO in the references?

Sent from my SM-G925F using Tapatalk
__________________
Code:
                 |||||
               @(~^~)@
-------------oOo---U---oOo-------------
|                                     |
|      Uncle Gizmo              |
|                                     |
|                                     |
| Get $20 worth of "Nifty Code"       |
|      
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| | Ooo | |_________________ooO____( )________| ( ) ) / \ ( (_/ \_)
Uncle Gizmo is online now   Reply With Quote
The Following User Says Thank You to Uncle Gizmo For This Useful Post:
SjCc (10-13-2018)
Old 10-13-2018, 04:25 AM   #3
SjCc
Newly Registered User
 
Join Date: Oct 2017
Posts: 35
Thanks: 19
Thanked 0 Times in 0 Posts
SjCc is on a distinguished road
Re: Class error 430

Quote:
Originally Posted by Uncle Gizmo View Post
The first thing to check, have you got a reference to ADO in the references?

Sent from my SM-G925F using Tapatalk
Thanks for reply indeed!! this is what attached file saying that i have added these.. please see
Attached Images
File Type: png Untitled.png (93.3 KB, 13 views)

SjCc is offline   Reply With Quote
Old 10-13-2018, 06:34 AM   #4
pbaldy
Wino Moderator
 
pbaldy's Avatar
 
Join Date: Aug 2003
Location: Nevada, USA
Posts: 31,929
Thanks: 9
Thanked 3,844 Times in 3,787 Posts
pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold
Re: Class error 430

What line throws the error?
__________________
Paul
Microsoft Access MVP

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
pbaldy is online now   Reply With Quote
The Following User Says Thank You to pbaldy For This Useful Post:
SjCc (10-13-2018)
Old 10-13-2018, 07:04 AM   #5
Uncle Gizmo
Nifty Access Guy
 
Uncle Gizmo's Avatar
 
Join Date: Jul 2003
Location: Newbury Berks UK
Posts: 9,458
Thanks: 358
Thanked 773 Times in 738 Posts
Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough
Send a message via Skype™ to Uncle Gizmo
Re: Class error 430

Also add:-

Option Compare Database
Option Explicit

Thus
__________________
Code:
                 |||||
               @(~^~)@
-------------oOo---U---oOo-------------
|                                     |
|      Uncle Gizmo              |
|                                     |
|                                     |
| Get $20 worth of "Nifty Code"       |
|      
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| | Ooo | |_________________ooO____( )________| ( ) ) / \ ( (_/ \_)
Uncle Gizmo is online now   Reply With Quote
The Following User Says Thank You to Uncle Gizmo For This Useful Post:
SjCc (10-13-2018)
Old 10-13-2018, 07:08 AM   #6
SjCc
Newly Registered User
 
Join Date: Oct 2017
Posts: 35
Thanks: 19
Thanked 0 Times in 0 Posts
SjCc is on a distinguished road
Re: Class error 430

Quote:
Originally Posted by pbaldy View Post
What line throws the error?
Yes it is here as attachment...
Attached Images
File Type: png error.png (28.8 KB, 17 views)
SjCc is offline   Reply With Quote
Old 10-13-2018, 07:12 AM   #7
SjCc
Newly Registered User
 
Join Date: Oct 2017
Posts: 35
Thanks: 19
Thanked 0 Times in 0 Posts
SjCc is on a distinguished road
Re: Class error 430

Quote:
Originally Posted by Uncle Gizmo View Post
Also add:-

Option Compare Database
Option Explicit

Thus
WOW Superb... done its working..... with no error.. thanks a million...

SjCc is offline   Reply With Quote
Old 10-13-2018, 07:17 AM   #8
Uncle Gizmo
Nifty Access Guy
 
Uncle Gizmo's Avatar
 
Join Date: Jul 2003
Location: Newbury Berks UK
Posts: 9,458
Thanks: 358
Thanked 773 Times in 738 Posts
Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough
Send a message via Skype™ to Uncle Gizmo
Re: Class error 430

Quote:
Originally Posted by SjCc View Post
WOW Superb... done its working..... with no error.. thanks a million...
__________________
Code:
                 |||||
               @(~^~)@
-------------oOo---U---oOo-------------
|                                     |
|      Uncle Gizmo              |
|                                     |
|                                     |
| Get $20 worth of "Nifty Code"       |
|      
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| | Ooo | |_________________ooO____( )________| ( ) ) / \ ( (_/ \_)
Uncle Gizmo is online now   Reply With Quote
Old 10-13-2018, 07:46 AM   #9
pbaldy
Wino Moderator
 
pbaldy's Avatar
 
Join Date: Aug 2003
Location: Nevada, USA
Posts: 31,929
Thanks: 9
Thanked 3,844 Times in 3,787 Posts
pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold
Re: Class error 430

Curiouser and curiouser.

__________________
Paul
Microsoft Access MVP

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
pbaldy is online now   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
System error "&H80040111 (-2147221231) Class factory cannot supply requested class davidb88 Excel 2 06-30-2014 05:03 AM
error 91 with custom class xcheshirecat Modules & VBA 1 06-10-2014 02:13 PM
How to raise error in class method such that calling code will be notified of error? mdlueck Modules & VBA 4 10-15-2012 04:13 AM
Correct syntax to make Class Function Private yet callable by instances of Class mdlueck Modules & VBA 4 11-07-2011 07:32 AM
Error Class not Registered (ADO) Michelangelo Modules & VBA 13 10-23-2003 11:37 PM




All times are GMT -8. The time now is 04:53 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World