bolox
asked on
hiya its BOLOX again for another quickie?
hmmm, that sounded rude, oh well here is the question:
I usually use a listbox to fill data in and use a click() option to get the reults back....
eg,
While Not myado.EOF
List1.AddItem myado!a
List1.ItemData(List1.NewIn dex) = myado!id
myado.MoveNext
Wend
End If
but now i have about 10 columns of text to go in.
i have tried using the listview............
ListView1.ColumnHeaders.Ad d , , "Airline"
ListView1.ColumnHeaders.Ad d , , "Class"
ListView1.ColumnHeaders.Ad d , , "From"
ListView1.ColumnHeaders.Ad d , , "Via"
ListView1.ColumnHeaders.Ad d , , "To"
ListView1.ColumnHeaders.Ad d , , "Fare Type"
ListView1.ColumnHeaders.Ad d , , "Valid From"
ListView1.ColumnHeaders.Ad d , , "Valid To"
ListView1.ColumnHeaders.Ad d , , "Validity"
ListView1.ColumnHeaders.Ad d , , "Net Adult"
ListView1.ColumnHeaders.Ad d , , "Gross Adult"
ListView1.View = lvwReport
Set results = ListView1.ListItems.Add(, , "one")
results.SubItems(1) = "one"
results.SubItems(2) = "three"
results.SubItems(3) = "three"
results.SubItems(4) = "three"
Set results = ListView1.ListItems.Add(, , "one")
results.SubItems(1) = "one"
results.SubItems(2) = "three"
results.SubItems(3) = "three"
results.SubItems(4) = "three"
Set results = ListView1.ListItems.Add(, , "one")
results.SubItems(1) = "one"
results.SubItems(2) = "three"
results.SubItems(3) = "three"
results.SubItems(4) = "three"
this looks good, but, what i want is that when i click on one of the lines for it to goto a new page with the index (pri key) for thsat data entry and to then show all data relating to that.
HOW!!???????
I usually use a listbox to fill data in and use a click() option to get the reults back....
eg,
While Not myado.EOF
List1.AddItem myado!a
List1.ItemData(List1.NewIn
myado.MoveNext
Wend
End If
but now i have about 10 columns of text to go in.
i have tried using the listview............
ListView1.ColumnHeaders.Ad
ListView1.ColumnHeaders.Ad
ListView1.ColumnHeaders.Ad
ListView1.ColumnHeaders.Ad
ListView1.ColumnHeaders.Ad
ListView1.ColumnHeaders.Ad
ListView1.ColumnHeaders.Ad
ListView1.ColumnHeaders.Ad
ListView1.ColumnHeaders.Ad
ListView1.ColumnHeaders.Ad
ListView1.ColumnHeaders.Ad
ListView1.View = lvwReport
Set results = ListView1.ListItems.Add(, , "one")
results.SubItems(1) = "one"
results.SubItems(2) = "three"
results.SubItems(3) = "three"
results.SubItems(4) = "three"
Set results = ListView1.ListItems.Add(, , "one")
results.SubItems(1) = "one"
results.SubItems(2) = "three"
results.SubItems(3) = "three"
results.SubItems(4) = "three"
Set results = ListView1.ListItems.Add(, , "one")
results.SubItems(1) = "one"
results.SubItems(2) = "three"
results.SubItems(3) = "three"
results.SubItems(4) = "three"
this looks good, but, what i want is that when i click on one of the lines for it to goto a new page with the index (pri key) for thsat data entry and to then show all data relating to that.
HOW!!???????
ASKER
something with grid lines like an excel type thing would be better, or at least with columns that would adjust and not have a huge amount of white space
When you add an item to the listitems collection the second parameter is a Key field, this can be used to refer to the listitem in future. Whilst it may not work with a purely numeric key, depending on the values in your primary key you can prepose a "Key" & <PrimaryKeyValue> so that it does. When you click on the item the ItemClick event is fired:
Private Sub ListView1_ItemClick(ByVal Item As ListItem)
'Call another form
Load frmSubForm
frmSubForm.Populate Item.Key
frmSubForm.Show vbModal,Me
End Sub
This pseudo-code shows how to load the form and then call a populate method with the key value of the clicked item, you then show the form with the details.
Private Sub ListView1_ItemClick(ByVal Item As ListItem)
'Call another form
Load frmSubForm
frmSubForm.Populate Item.Key
frmSubForm.Show vbModal,Me
End Sub
This pseudo-code shows how to load the form and then call a populate method with the key value of the clicked item, you then show the form with the details.
Bolox,
Why do you not use a flex grid instead.
They are really easy to use and format.
Also, when you have your data loaded into the grid, If you click on a row or cell You can see what value is in it.
This may help you in going to a new page and showing all the related information.
Hope it helps
Why do you not use a flex grid instead.
They are really easy to use and format.
Also, when you have your data loaded into the grid, If you click on a row or cell You can see what value is in it.
This may help you in going to a new page and showing all the related information.
Hope it helps
ASKER
flex grid looks much better, and there is an easier way to select a row.
Any pointers as to assign some text to each columns and ading the on_click method???
MORE POINTS IF YOU DO
Any pointers as to assign some text to each columns and ading the on_click method???
MORE POINTS IF YOU DO
ASKER
SORRY BUT I ONLY HAVE ANOTHER 3 POINTS AVAIL NOW, SO THIS 50 IS ALL I CAN OFFER
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Or if you really want to use the Click event:
Private Sub MSFlexGrid1_Click()
MsgBox MSFlexGrid1.TextMatrix(MSF lexGrid1.M ouseRow, MSFlexGrid1.MouseCol)
End Sub
Private Sub MSFlexGrid1_Click()
MsgBox MSFlexGrid1.TextMatrix(MSF
End Sub
ASKER
on entering ..
MSFlexGrid1.TextMatrix(3, 7) = "Hello Bolox"
it says it is out of range?
MSFlexGrid1.TextMatrix(3, 7) = "Hello Bolox"
it says it is out of range?
ASKER
ignore that, i forgot to add more cols and rows
ASKER
well done. your guys and gals are the best, shame i have no points left again. just havew to answer some more questions for a change then
Thanx again
Gavin AKA Bolox
Thanx again
Gavin AKA Bolox
ASKER