Solved

Deleting last non-fixed row in MSFlexGrid

Posted on 1999-01-13
2
1,825 Views
Last Modified: 2008-03-03
I am using MSFlexGrid in VB5.0 to display an Access database. I've set the first row of the grid to be 'fixed' in order to display the column headers. However, when I tried to remove the last non-fixed row in the grid, I get an error: "Runtime error 30015: Cannot remove last non-fixed row" . I've decided to include a check in my code so that whenever I have only one non-fixed row left, I use the Clear method instead of the RemoveItem method. Is there a better way around it?
0
Comment
Question by:meko
  • 2
2 Comments
 
LVL 3

Accepted Solution

by:
traygreen earned 50 total points
ID: 1456104
Rather than use the removeitem method, implicitly set the number of rows to get rid of the last item.  That way you do not have to reset the formatstring as after a clear.
0
 
LVL 3

Expert Comment

by:traygreen
ID: 1456105
EG of above...
will leave just the header row....
Private Sub Command1_Click()
   MSFlexGrid1.Rows = 1
End Sub

will leave the header row + 1 blank row...
Private Sub Command2_Click()
   MSFlexGrid1.Rows = 1
   MSFlexGrid1.Rows = 2
End Sub
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…

776 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