Solved

alphabetize flexgrid contents

Posted on 2014-11-27
10
77 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
  • 7
  • 3
10 Comments
 
LVL 45

Expert Comment

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

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
 
LVL 45

Expert Comment

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

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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 45

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 45

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 45

Expert Comment

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now