Results 1 to 3 of 3

Thread: DBGrid Issues

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2011
    Posts
    2

    DBGrid Issues

    I've inherited a VB6 app written in 2000, and am more a VBA coder than VB...

    I have registered the DBGRID32.OCX successfully. When running the app, it stops at "DBGrid1.SetFocus" with Error 424, Object required. When I attempt to re-type the line, I notice that there is no intellisense dropdown after I type "dbgrid1.". I have looked all over and don't see a "DBGrid?" control on the form.

    I apologize for asking what may be a very simple question to answer. Any help would be most appreciated.

    John

  2. #2
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Re: DBGrid Issues

    Most likely the control named DBGrid1 does not exist on the form. Try setting a breakpoint at the SetFocus line and check if DBGrid1 does indeed point to an existing control.

    If I remember correctly, if the DBGrid control wasn't registered and if you opened the app in VB6 code editor and tried to view the form, the DBGrid control would most likely be removed from the form (as it wasn't registered). If you then saved it, you would essentially be saving the form sans the control.

    A solution would be to add it back, however you need to test the code thoroughly to ensure the control properties are set to the correct values.

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2011
    Posts
    2

    Re: DBGrid Issues

    Ah, when I look at another form, I do see a DBGrid1 control. I looked back at the original code and it also does not have a dbgrid control on the errant form! I added a DBGrid1 control. When I attempt to add another, it wants to create it as an array. But the code is calling dbgrid1, dbgrid2, dbgrid3, dbgrid4 - instead of dbgrid(index).

    Edit: Okay, getting somewhere - added a datagrid control, renamed to dbgrid4, then 3, then 2, and finally 1. Now, to get the table headers like I see on the other form...
    Edit: Found Datasource property, set to Data1 which I see in the code. I now get data on the 1st "tab", but it doesn't change for the other 3...

    I think I'm getting there, and I THANK YOU for the nudge in the right direction!

    Good News! I got all 4 to working, now to fix the navigation bar at the bottom. Man, someone really messed this thing up bad. The code was all mixed up. I'm not even sure if this functionality even worked at all before. I'll find out when I next talk to the person who asked me to look at it.

    Thanks again for the nudge!
    Last edited by fdcusa; Jan 3rd, 2011 at 04:51 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width