Solved

Flexgrid?

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

762 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

21 Experts available now in Live!

Get 1:1 Help Now