Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Flexgrid?

Posted on 2001-09-17
5
Medium Priority
?
194 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 1200 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

Hire Technology Freelancers with Gigs

Work with 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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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

926 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