Solved

alphabetize flexgrid contents

Posted on 2014-11-27
10
84 Views
Last Modified: 2014-11-28
I need a way to alphabetize the contents of my MSFlexgrid in the attached project.  I am pulling the websites from a text file to a flexgrid, but using this style of grid, how could I organize the sites alphabeticallly from a text file?
CB--2-.zip
0
Comment
Question by:al4629740
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 3
10 Comments
 
LVL 47

Expert Comment

by:Martin Liss
ID: 40469591
OK, I'm working on it.
0
 
LVL 47

Accepted Solution

by:
Martin Liss earned 500 total points
ID: 40469751
OK I hope this isn't a turkey:)

This version includes
Changes to handle a sorted grid
When the Add Record button is clicked you no longer have to double-click the cell
When the user clicks the "X" to end the application and there have been changes made, the application will give him a chance to save them
Since this application is more complex then it was before I added annotations at the places where I made the current changes. I also added a changelog module to document those changes. See this article of mine if you want to be able to easily do that in this or future applications.
Q-28570862.zip
0
 

Author Comment

by:al4629740
ID: 40469774
Martin, I just opened it and tested it.  It keeps getting better.  Much appreciated.

I like the annotations suggestion.  When the code starts mounting, its easy to forget what was done.

Thank you very much and enjoy your evening!
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 47

Expert Comment

by:Martin Liss
ID: 40469859
Once again you're welcome.
0
 
LVL 47

Expert Comment

by:Martin Liss
ID: 40469870
You might want to make a small change. If you add a website which alphabetically is "off the screen" (like if you added "aaaaa.com") you won't see it using the current code unless you scroll to it. If you change this
Private Sub SortGrid()
'******* Q_28570862a Start *******
Dim intEntry As Integer
Dim intRow As Integer

' Sort the grid and add the GridRow vales to arrAlloed
MSFlexGrid1.Sort = flexSortGenericAscending
For intRow = 0 To MSFlexGrid1.Rows - 1
    For intEntry = 0 To UBound(arrAllowed)
        If MSFlexGrid1.TextMatrix(intRow, 0) = arrAllowed(intEntry).MatchValue Then
            arrAllowed(intEntry).GridRow = intRow
            Exit For
        End If
    Next
Next
'******* Q_28570862a End *********
End Sub

Open in new window

to this you will.
Private Sub SortGrid()
'******* Q_28570862a Start *******
Dim intEntry As Integer
Dim intRow As Integer

' Sort the grid and add the GridRow vales to arrAlloed
MSFlexGrid1.Sort = flexSortGenericAscending
For intRow = 0 To MSFlexGrid1.Rows - 1
    For intEntry = 0 To UBound(arrAllowed)
        If MSFlexGrid1.TextMatrix(intRow, 0) = arrAllowed(intEntry).MatchValue Then
            arrAllowed(intEntry).GridRow = intRow
            Exit For
        End If
    Next
Next
MSFlexGrid1.Row = arrAllowed(UBound(arrAllowed)).GridRow
MSFlexGrid1.TopRow = arrAllowed(UBound(arrAllowed)).GridRow
'******* Q_28570862a End *********
End Sub

Open in new window

0
 
LVL 47

Expert Comment

by:Martin Liss
ID: 40469909
Currently if you add "aaa.com"  the output file will look like this:
allowed.hsd1.il.comcast.net
^(.*\.)?hsd1.il.comcast.net$
;
ALLOW_DROPBOX_r05-02-2013
^db\.tt$
^(.*\.)?dropboxusercontent\.com$
;
;ALLOW_FACEBOOK_r02-31-2013
^fb\.me$
^(.*\.)?facebook\.com$
^(.*\.)?fbcdn\.com$
^(.*\.)?fbcdn\.net$
;
;ALLOW_TWITTER_r02-28-2013
^t\.co$
^(.*\.)?twimg\.com$
^(.*\.)?twitter\.com$
;
;ALLOW_YOUTUBE_r11-05-2012
^(.*\.)?youtube\.com$
^(.*\.)?youtube-nocookie\.com$
^(.*\.)?abc\.com$
^(.*\.)?googlevideo\.com$
;ALLOW_YOUTUBE_OPTIONAL
^(.*\.)?just1tube\.com$
^(.*\.)?wix\.com$
^(.*\.)?infusionsoft\.com$
^(.*\.)?msexchange\.org$
^(.*\.)?google\.com$
^(.*\.)?googleusercontent\.com$
^(.*\.)?craigslist\.org$
^(.*\.)?microsoftonline\.com$
^(.*\.)?weebly\.com$
^(.*\.)?yahoo\.com$
^(.*\.)?aaa\.xxx$

Would you like it to be

allowed.hsd1.il.comcast.net
^(.*\.)?hsd1.il.comcast.net$
;
ALLOW_DROPBOX_r05-02-2013
^db\.tt$
^(.*\.)?dropboxusercontent\.com$
;
;ALLOW_FACEBOOK_r02-31-2013
^fb\.me$
^(.*\.)?facebook\.com$
^(.*\.)?fbcdn\.com$
^(.*\.)?fbcdn\.net$
;
;ALLOW_TWITTER_r02-28-2013
^t\.co$
^(.*\.)?twimg\.com$
^(.*\.)?twitter\.com$
;
;ALLOW_YOUTUBE_r11-05-2012
^(.*\.)?youtube\.com$
^(.*\.)?youtube-nocookie\.com$
^(.*\.)?abc\.com$
^(.*\.)?googlevideo\.com$
;ALLOW_YOUTUBE_OPTIONAL
^(.*\.)?just1tube\.com$
^(.*\.)?wix\.com$
^(.*\.)?infusionsoft\.com$
^(.*\.)?msexchange\.org$
^(.*\.)?google\.com$
^(.*\.)?googleusercontent\.com$
^(.*\.)?craigslist\.org$
^(.*\.)?microsoftonline\.com$
^(.*\.)?weebly\.com$
^(.*\.)?yahoo\.com$
;ALLOW_MISCELLANEOUS_r11-27-2014
^(.*\.)?aaa\.xxx$
0
 

Author Comment

by:al4629740
ID: 40470021
That would be great if it was that way.
0
 
LVL 47

Expert Comment

by:Martin Liss
ID: 40470406
New question or here?

I also found a bug that I'll fix in either case.
0
 

Author Comment

by:al4629740
ID: 40470516
New question
0
 
LVL 47

Expert Comment

by:Martin Liss
ID: 40470523
OK thanks. I've actually found a few bugs that I'm fixing now.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question