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

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1529
  • Last Modified:

MS Forms 2.0 Object Library - ComboBox

I was looking for some examples on how to use the ComboBox with
adding items if i have more than one column ect....

When I do a F1 on the control it says that it can't find the frm20.hlp help file.
Does anybody have this help file?

If so could you email it to jrcp@mctcnet.net otherwise an example would be great.

Thanks,
Jcrp
0
geo90
Asked:
geo90
  • 3
  • 2
  • 2
  • +1
1 Solution
 
CrinCommented:
check your mail :))

WBR

Crin
0
 
caraf_gCommented:
So much for a knowledge *sharing* community :-(
0
 
caraf_gCommented:
PS - The forms2.0 library is total rubbish. Try tabbing *backwards* out of one of its controls and you'll see what I mean. Yuck.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
CrinCommented:
Ok, will repeat here :))


AddItem [Text for first column], Index (number of row) where row must appear.

Example 1:

Me.ComboBox1.AddItem "", 1
Me.ComboBox1.AddItem "", 2
Me.ComboBox1.AddItem "", 3

Me.ComboBox1.List(1, 1) = "Text for Column 1 of Row 1"
Me.ComboBox1.List(1, 2) = "Text for Column 2 of Row 1"
Me.ComboBox1.List(3, 1) = "Text for Column 1 of Row 3"



Example 2:

Suppose we have table contained Fields FirstName, SurName, Phone and ID


Dim Rs as Recordset, i as Long

Set Rs = db.OpenRecordset("MyTable")
if Rs.RecordCount> 0 then
  With Me.Combo1
    .Clear
    .ColumnCount = 4
    .BoundColumn = 1   'will store IDs
    .ColumnWidths = "0;1;1;1"   'Hide IDs from user by setting its column width to 0
    rs.MoveFirst
    'Add each record to Combo
    while not Rs.EOF
      .AddItem "", i
      .List(i,1) = Rs!ID
      .List(i,2) = Rs!FirstName
      .List(i,3) = Rs!SurName
      .List(i,4) = Rs!Phone
      i=i+1
      Rs.MoveNext
    Wend
  end with
end if
rs.close


With best regards

Crin
0
 
geo90Author Commented:
Thanks a lot!
0
 
CrinCommented:
Hope my comments was useful :))

Crin
0
 
MaritimerCommented:
I am just testing right now. Will let you know shortly
0
 
MaritimerCommented:
When the user clicks on the Combo. What is the syntax to retrive fthe value from a spicific column??
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now