Results 1 to 5 of 5

Thread: [RESOLVED] FlexGrid Format Cell's

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2003
    Posts
    233

    Resolved [RESOLVED] FlexGrid Format Cell's

    Hi


    I want to format the ComboBox text which placing over the FlexGrid

    The result will show in FG2 cell in .Col 18 like that

    dataincellxdataincellxdataincellxdataincellxdataincell

    Where x is separates the cell data

    If there is no data in any cell's then we want to make sure there is'nt tow xx behaind each other

    VB Code:
    1. Private Sub Command1_Click()
    2.  
    3. With FG2
    4.  
    5. .Col = 18
    6. .Text = Combo6.Text & "x" & Combo7.Text & "x" & Combo9.Text & "x" & Combo10.Text & "x" & _
    7. Combo14.Text & "x" & Combo15.Text & "x" & Combo17.Text & "x" & Combo18.Text & "x" & _
    8. Combo23.Text & "x" & Combo24.Text & "x" & Combo26.Text & "x" & Combo27.Text & "x" & _
    9. Combo31.Text & "x" & Combo32.Text & "x" & Combo34.Text & "x" & Combo35.Text
    10. FG2.Text = Replace(FG2.Text, "xx", "x") ' If there is more then 2 xx it want work
    11.  
    12. ' Also if i enter the data in any combo then i press the command
    13. ' then i clear the data and press the command it want work
    14. End With
    15.  
    16. End Sub

    What i miss

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: FlexGrid Format Cell's

    A quick loop will work

    VB Code:
    1. Do
    2.         If InStr(1, strTemp, "xx") = 0 Then Exit Do
    3.         strTemp = Replace(strTemp, "xx", "x")
    4.     Loop

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

    Re: FlexGrid Format Cell's

    instead you can change your code with the IIf statement like
    VB Code:
    1. .Col = 18
    2. .Text =
    3. IIf(Trim(Combo6.Text) = "", "", Combo6.Text & "x") & _
    4. IIf(Trim(Combo7.Text) = "", "", Combo7.Text & "x") & _
    5. IIf(Trim(Combo9.Text) = "", "", Combo9.Text & "x")
    6. '...and so on
    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.


  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Nov 2003
    Posts
    233

    Re: FlexGrid Format Cell's

    Thank's brucevde

    ganeshmoorthy

    Both working

    Except that if i choose only 1 combo and click the command the format will be like that

    Dataincellx

    The x is only separates the data

    The x not start befor the data and it will not be after the data

    I will try work on it

    Thank's
    Last edited by jamal464; Dec 2nd, 2006 at 12:12 PM.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Nov 2003
    Posts
    233

    Re: FlexGrid Format Cell's

    Quote Originally Posted by ganeshmoorthy
    instead you can change your code with the IIf statement like
    VB Code:
    1. .Col = 18
    2. .Text =
    3. IIf(Trim(Combo6.Text) = "", "", Combo6.Text & "x") & _
    4. IIf(Trim(Combo7.Text) = "", "", Combo7.Text & "x") & _
    5. IIf(Trim(Combo9.Text) = "", "", Combo9.Text & "x")
    6. '...and so on
    I thought it was solved but i figure that the result for combo.text it will be all the same for all row's in .Col 18

    I want each row got his own format shown in .Col 18
    Last edited by jamal464; Dec 8th, 2006 at 04:23 PM.

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