Results 1 to 13 of 13

Thread: [RESOLVED] Simple MDI problem

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2006
    Posts
    365

    Resolved [RESOLVED] Simple MDI problem

    Hi all,

    I'm trying to link my MDI child to the parent.
    Although, there's no error when i run the program, but when i click the child form, there's no respond. I suspect the program cant read my child form or the name isn't correctly label.

    May someone pls solve my query. Thanks.

    Below is the link to my program.

    http://s30.yousendit.com/d.aspx?id=1...22NPXG8I775S2R

  2. #2
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: Simple MDI problem

    could you post the code where you r loading the child form.... I dont have option to open the attachments.
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  3. #3
    Hyperactive Member CHAMPGARY's Avatar
    Join Date
    Jul 2002
    Posts
    386

    Re: Simple MDI problem

    Hi MACKY,

    I found a small mistakes in your code.

    In the mnuCarDetaila menu click event you have not written any code
    that's why no action taken when you click menu 'Group A '. I think you have change the menu name after you had write code. Becoz I found the code for loading form in 'CarDetaila' menu click event, which is not exist in you menu items. Please check the menu names and code for menu click event.

    Also be sure that the forms you are loading on menu click must be added in the project.
    Regards,
    CHAMPGARY

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2006
    Posts
    365

    Re: Simple MDI problem

    Quote Originally Posted by ganeshmoorthy
    could you post the code where you r loading the child form.... I dont have option to open the attachments.
    Under the Main form,

    VB Code:
    1. Private Sub CarDetaila_Click()
    2. Unload CarDetailb
    3. Unload CarDetailc
    4. Unload SearchCustID
    5. Unload SearchCar
    6. Unload SearchInvoice
    7. Unload Customer
    8. Unload rent
    9. Unload returned
    10.  
    11. Load CarDetaila
    12. CarDetaila.Show
    13. End Sub

    There is no compile error in my form but when i click on cardetaila, there's no reaction.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2006
    Posts
    365

    Re: Simple MDI problem

    Quote Originally Posted by CHAMPGARY
    Hi MACKY,

    I found a small mistakes in your code.

    In the mnuCarDetaila menu click event you have not written any code
    that's why no action taken when you click menu 'Group A '. I think you have change the menu name after you had write code. Becoz I found the code for loading form in 'CarDetaila' menu click event, which is not exist in you menu items. Please check the menu names and code for menu click event.

    Also be sure that the forms you are loading on menu click must be added in the project.
    Hi CHAMPGARY,

    Thanks for the reply.
    Can u explain furthur wat type of code do i need to write.


  6. #6
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: Simple MDI problem

    do you want to unload all the other forms in that event....no harm...but think twice....

    after the load CarDetaila statement just give msgbox "Form Loaded" and then after CarDetaila.Show give again "Form Showed".

    and see whether you are getting these msg boxes....
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  7. #7
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: Simple MDI problem

    I'm sorry... I dint notice the mistake in your code...
    just move the CarDetaila_Click event's code to mnuCarDetaila_Click event
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2006
    Posts
    365

    Re: Simple MDI problem

    hi ganeshmoorthy,

    Is this what u mean?
    Well, there still no differences from the earlier one.

    VB Code:
    1. Private Sub CarDetaila_Click()
    2. Unload CarDetailb
    3. Unload CarDetailc
    4. Unload SearchCustID
    5. Unload SearchCar
    6. Unload SearchInvoice
    7. Unload Customer
    8. Unload rent
    9. Unload returned
    10.  
    11. Load CarDetaila
    12. If CarDetaila = True Then
    13. MsgBox ("Form loaded")
    14. End If
    15. CarDetaila.Show
    16. If CarDetaila = True Then
    17. MsgBox ("Form shown")
    18. End Sub

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2006
    Posts
    365

    Re: Simple MDI problem

    Quote Originally Posted by ganeshmoorthy
    I'm sorry... I dint notice the mistake in your code...
    just move the CarDetaila_Click event's code to mnuCarDetaila_Click event
    Ok .. thks ganeshmoorthy and CHAMPGARY. I think i got it.

    But initally i change both names to cardetaila, it prompt me an error member or data methods not found.
    Pardon me, do i have to put a mnu in front of my form?

  10. #10
    Hyperactive Member CHAMPGARY's Avatar
    Join Date
    Jul 2002
    Posts
    386

    Re: Simple MDI problem

    Quote Originally Posted by macky^^
    Hi CHAMPGARY,

    Thanks for the reply.
    Can u explain furthur wat type of code do i need to write.


    For that
    copy your code from the CarDetaila_Click() and paste it into
    mnuCarDetaila_Click()
    I have made changes in main form and attached with this.
    Have a look.

    Don't unload each form in menu click event. You unload all the forms in 'Exit' menu click event. That is ideal. If you really want to do so use
    for loop for that.
    Attached Files Attached Files
    Regards,
    CHAMPGARY

  11. #11

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2006
    Posts
    365

    Re: Simple MDI problem

    Thanks CHAMPGARY.
    For sharing your vast knowledge.

  12. #12
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: Simple MDI problem

    It is not mandatory to put mnu with the menu name, but is suggested and this is what called as naming conventions. on seeing the sub itself you can determine that this is menu event.
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  13. #13
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Simple MDI problem

    Quote Originally Posted by ganeshmoorthy
    It is not mandatory to put mnu with the menu name,
    This is true, but it should ALWAYS happen, just like all strings should start with str, integers with int, etc.

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