CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2010
    Posts
    18

    Need Urgent Help - Text Box and Grid

    Dear Friends,

    Once again i am coming with a new request.

    Now i am doing one Estate Project using VB6 and MS-SQL.

    Now i am facing one problem now.

    I am enclosing herewith a screenshot for your kind perusal.

    I need 2 things.

    1. There are 4 Text boxes and 3 combo boxes...Some calculations is also there. After complete the 1st entry, if i press "Add+" Button, the values must go to Grid and text boxes must clear. Now 2nd Entry, Again i will press "Add+" button, the 2nd row values must go to Grid....Likewise, "n" no. of rows must go to grid.

    2. Consider, i have enter 38 or 50 rows, Now i will press "Update" button, the grid values will store into appropriate fields in Database.

    3. After successful saved, in future if need, i must edit a particular row in that grid. If i click a particular row in grid, the values will come to appropriate text boxes and combo boxes.

    I need code help for the above needs. I am expecting your valueble reply soon.

    Thanks & Regards,

    Guna
    Attached Images Attached Images  

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Need Urgent Help - Text Box and Grid

    What controls are those? Doesn't look like VB6
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: Need Urgent Help - Text Box and Grid

    Those are VB 6 controls, just formatted a bit

    What code have you done so far Guna? Where precisely is the problem?

  4. #4
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Need Urgent Help - Text Box and Grid

    My article may be helpful. Download the code, and take a look!
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Aug 2003
    Location
    Sydney, Australia
    Posts
    1,900

    Re: Need Urgent Help - Text Box and Grid

    I'll help you with the first part ...

    I assume you are using MsFlexGrid or MSHFlexGrid

    In The FormLoad Event

    Code:
    Grid1.FormatString = "   |<Heading 1 Left Aligned|>Heading 2 Right Aligned|<Heading 3       "
    In the ADD + Click Event (This will populate the grid - you choose the exact fields and which order you want them)

    Code:
    Dim MyStr as String
    MyStr = Text1.text & Chr(9) & Text2.text & Chr(9) & Combo1.text & Chr(9) &  Text3.text & Chr(9) & Text4.text  
    
    Grid1.Additem MyStr

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

Featured