Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

alphabetize flexgrid contents

Posted on 2014-11-27
10
Medium Priority
?
87 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 49

Expert Comment

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

Accepted Solution

by:
Martin Liss earned 2000 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 49

Expert Comment

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

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 49

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 49

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 49

Expert Comment

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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

730 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