Solved

Flexgrid?

Posted on 2001-09-17
5
176 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code 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.
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…
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…

770 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