Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to debug "Object doesn't support this property or method"

Status
Not open for further replies.

Dougpeplow

Programmer
Feb 1, 2000
57
FR
I'm developing a VB form with a data control, DBGrids, frame and tabstrip. I load data into an MSAcces DB and use the data control to 'populate' the DBgrids for display purposes. All goes well until the final stages when I make the 'dbgrids.visible = true' and show the form. I get the "Object doesn't support this property or method" as a message box, but on clicking 'OK' on the message box ,the form displays everything I expect. Cclicking the 'help' button doesn't identify which object is at fault. Any idea how I can debug this to get to the offending item please?
 
Set a stop (F9) on the last line you think is no problem. Then step through the code with F8. The error message will appear and you will know which statement is generating the error.

Herman :-Q
 
Still a problem
The code is all in the 'Form_load()' and executes right to the end where I put the F9. The final statements are :

DBGrid1(0).Visible = True
DBGrid1(1).Visible = True: Frame1.Visible = False
End Sub

The programme steps out of the 'EndSUb' before the error message appears. the next statement that' highlighted when I debug the code is the first line of:

Sub Command1_Click()
Unload Me
End Sub
 
Hi Dougpeplow,

Which version of Visual Basic do you use? In VB4 the DBGrid had no default property which would cause this error. If you're using a later version then you could follow next steps:
1. Create a new project without frame and tabstrip. Place the dbgrids on a form and run the project. Then you will know which control is (not) causing the error.
or,
2. Cut the code in the form_load and put it in a sub which is executed when you click a command button. You could then step through the sub which makes it easier to identify the the line which causes the error.

Good Luck, Herman :-Q
 
Thanks for assist - I eventually had to strip ojects from the form until I found that I had placed the DBGrid on the SSTAB, not on the underlying form. SSTAB does not support DBGRID as an control/method
dougpeplow
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top