By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,642 Members | 2,136 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,642 IT Pros & Developers. It's quick & easy.

Object doesn't support this property or method

P: 62
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.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. Vform = 1
  3. Me.Height = 7800
  4. Me.Width = 11565
  5. OpenDB
  6. BindControls
  7. MDIVehicleTracker.MnuClose.Enabled = True
  8. MDIVehicleTracker.MnuSave.Enabled = True
  9. MDIVehicleTracker.MnuDelete.Enabled = True
  10. MDIVehicleTracker.MnuExSheet.Enabled = True
  11. MDIVehicleTracker.MnuWrdSheet.Enabled = True
  12. Set NewWs = DBEngine.CreateWorkspace("dbtemp", "admin", "")
  13. Set NewDb = NewWs.OpenDatabase(App.Path & "\VEHICLE_TRACKER.mdb")
  14. End Sub
  15.  
  16. Private Sub OpenDB()
  17.     DVehType.DatabaseName = App.Path & "\VEHICLE_TRACKER.mdb"
  18.     DVehType.RecordSource = "VEH_TYPE"
  19.     DVehType.Refresh
  20. End Sub
  21.  
  22. Private Sub BindControls()
  23. On Error GoTo ErrorHandler
  24.     DBCVehType.ListField = "VEHICLE_TYPE"
  25.     DVehType.Visible = False
  26. ErrorHandler:
  27.     If Err.Number = 3021 Then
  28.         MsgBox "There is no available record in the database", vbInformation
  29.     End If
  30. End Sub
  31.  
and these are the declarations of the variables
Expand|Select|Wrap|Line Numbers
  1. Public NewDb As Database
  2. Public NewWs As Workspace
  3. Public VehType As String
  4. Public Vform As Integer
  5.  
Nov 15 '06 #1
Share this Question
Share on Google+
2 Replies


100+
P: 1,646
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
Nov 15 '06 #2

P: 62
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.
Nov 16 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.