Solved

Flexgrid?

Posted on 2001-09-17
5
174 Views
Last Modified: 2010-05-02
Private Declare Function BringWindowToTop Lib "user32" (ByVal hwnd As Long) As Long

Private Sub Form_Load()
FG.Rows = 1
FG.Row = 0
FG.Col = 0
FG.ColWidth(0) = 1485
FG.Text = "Ejendomsnummer:"
FG.Col = 1
FG.Text = "Klientnummer:"
FG.ColWidth(1) = 1285
FG.Col = 2
FG.Text = "Tilknyttet m?gler:"
FG.ColWidth(2) = 1485
FG.Col = 3
FG.Text = "Afgivet bud:"
FG.ColWidth(3) = 1085
FG.Col = 4
FG.Text = "Sagsstatus:"
FG.ColWidth(4) = 1485
For x = 0 To 4
fgwidth = fgwidth + FG.ColWidth(x)
Next
FG.Width = fgwidth + 8
FG.Col = 0
AddNew 65, 4, "Gert ffgfHansen", "12003400", 9
AddNew 65, 13433, "Gert fgfgHansen", "1234000", 1
'AddNew 56, 5, "Gert gfgffgHansen", "12034000", 3
'AddNew 23, 645, "Geffgfgrt Hansen", "12034000", 4
'AddNew 43, 23, "Gert ffdgHansen", "12340000", 5
'AddNew 23, 53, "Gert ggfdHansen", "12430000", 6
'AddNew 2, 33, "Gert Hagfdgnsen", "12034000", 7
'AddNew 54, 3, "Gert Hafgnsen", "12003400", 10

End Sub

Sub AddNew(Ejendomsnummer As Long, Klientnummer As Long, TilKnyttetM?gler As String, AfgivetBud As String, SagsStatus As Long)
FG.Rows = FG.Rows + 1
FG.Row = FG.Rows - 1
FG.Col = 0
FG.Text = Ejendomsnummer
FG.CellAlignment = 0
FG.Col = 1
FG.Text = Klientnummer
FG.CellAlignment = 0
FG.Col = 2
FG.Text = TilKnyttetM?gler
FG.CellAlignment = 0
FG.Col = 3
FG.Text = AfgivetBud
FG.CellAlignment = 0
Load Bar(Bar.UBound + 1)
Set CurrBar = Bar(Bar.UBound)
CurrBar.Left = FG.ColPos(4)
CurrBar.Height = (FG.RowHeight(1) * FG.Row) - 10
CurrBar.Top = FG.RowHeight(0)
CurrBar.Width = FG.ColWidth(4) - 10
CurrBar.Value = SagsStatus
CurrBar.Visible = True
BringWindowToTop CurrBar.hwnd
Set CurrBar = Nothing
FG.Col = 0
End Sub

I have this code, it is supposed to make a new progressbar for each row, but if i set one progressbarvalue all the values changes....

can anybody help?
0
Comment
Question by:5
  • 3
5 Comments
 
LVL 22

Expert Comment

by:rspahitz
ID: 6488415
Why are you loading a new bar eash time you add an item:

    Load Bar(Bar.UBound + 1)

then throwing it away at the end:

    Set CurrBar = Nothing
???


0
 
LVL 38

Expert Comment

by:PaulHews
ID: 6488430
Looks Ok to me so far.
Where's the code where you change the progbar value?
0
 
LVL 38

Accepted Solution

by:
PaulHews earned 300 total points
ID: 6488450
I think you have mixed up the code to change the CurrBar.Top with the code to change the CurrBar.Height.  You are probably only seeing one wide bar.
0
 

Author Comment

by:5
ID: 6488488
lol..yup..that was it....duh! thank you :)
0
 
LVL 38

Expert Comment

by:PaulHews
ID: 6488496
Sometimes the simplest mistakes are the hardest to spot.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
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…

867 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

19 Experts available now in Live!

Get 1:1 Help Now