Solved

MS Forms 2.0 Object Library - ComboBox

Posted on 2000-04-10
8
1,399 Views
Last Modified: 2011-04-14
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
Comment
Question by:geo90
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 2

Expert Comment

by:Crin
ID: 2700798
check your mail :))

WBR

Crin
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 2700817
So much for a knowledge *sharing* community :-(
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 2700821
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
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!

 
LVL 2

Accepted Solution

by:
Crin earned 50 total points
ID: 2700973
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
 

Author Comment

by:geo90
ID: 2701542
Thanks a lot!
0
 
LVL 2

Expert Comment

by:Crin
ID: 2701551
Hope my comments was useful :))

Crin
0
 

Expert Comment

by:Maritimer
ID: 22238219
I am just testing right now. Will let you know shortly
0
 

Expert Comment

by:Maritimer
ID: 22238311
When the user clicks on the Combo. What is the syntax to retrive fthe value from a spicific column??
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

691 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