Object doesn't support this property or method

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nkechifesie
    New Member
    • Nov 2006
    • 62

    #1

    Object doesn't support this property or method

    When i run my program and try to open a form I get this error ( Object doesn't support this property or method). I have tried all i can to locate where but it doesnt show me where but these are the codes that are used when it opens that particular form.

    Code:
    Private Sub Form_Load()
    Vform = 1
    Me.Height = 7800
    Me.Width = 11565
    OpenDB
    BindControls
    MDIVehicleTracker.MnuClose.Enabled = True
    MDIVehicleTracker.MnuSave.Enabled = True
    MDIVehicleTracker.MnuDelete.Enabled = True
    MDIVehicleTracker.MnuExSheet.Enabled = True
    MDIVehicleTracker.MnuWrdSheet.Enabled = True
    Set NewWs = DBEngine.CreateWorkspace("dbtemp", "admin", "")
    Set NewDb = NewWs.OpenDatabase(App.Path & "\VEHICLE_TRACKER.mdb")
    End Sub
    
    Private Sub OpenDB()
        DVehType.DatabaseName = App.Path & "\VEHICLE_TRACKER.mdb"
        DVehType.RecordSource = "VEH_TYPE"
        DVehType.Refresh
    End Sub
    
    Private Sub BindControls()
    On Error GoTo ErrorHandler
        DBCVehType.ListField = "VEHICLE_TYPE"
        DVehType.Visible = False
    ErrorHandler:
        If Err.Number = 3021 Then
            MsgBox "There is no available record in the database", vbInformation
        End If
    End Sub
    and these are the declarations of the variables
    Code:
    Public NewDb As Database
    Public NewWs As Workspace
    Public VehType As String
    Public Vform As Integer
  • willakawill
    Top Contributor
    • Oct 2006
    • 1646

    #2
    Originally posted by nkechifesie
    When i run my program and try to open a form I get this error ( Object doesn't support this property or method). I have tried all i can to locate where but it doesnt show me where but these are the codes that are used when it opens that particular form.


    [/code]
    Hi. If you click on the left margin at the start of your code in the vb editor window the program will stop at that point when you run it and you can step through the lines of code one at a time using F8
    This will show you where the problem is.

    Good luck

    Comment

    • nkechifesie
      New Member
      • Nov 2006
      • 62

      #3
      Originally posted by willakawill
      Hi. If you click on the left margin at the start of your code in the vb editor window the program will stop at that point when you run it and you can step through the lines of code one at a time using F8
      This will show you where the problem is.

      Good luck
      I already did that and it still gave me no clue but thanks. I decided to start eliminating some lines by making them comment and running it and later on discovred that it was a variable giving the problem. Thanks for your help.

      Comment

      Working...