grams
07-06-2001, 07:02 AM
Is there a control like a list box or datacombo control that would allow me to select more than one item from the list? My back end is an Access database.
DataCombo Controlgrams 07-06-2001, 07:02 AM Is there a control like a list box or datacombo control that would allow me to select more than one item from the list? My back end is an Access database. Laurent 07-06-2001, 07:08 AM i think msflexgid does this try it out, you'll to get the reference in your project. I'll be among the best soon, very soon!!! grams 07-06-2001, 07:55 AM I am trying the flexgrid...but it is giving me an error when I try to select a datasource. I have tried a dataenvironment and an ado datacontrol as my source, but it says to "add an intrinsic data control or a remote data control to the form". Can you clarify this? Thanks! <P ID="edit"><FONT class="small"><EM>Edited by grams on Fri Jul 06 09:55 AM.</EM></FONT></P> dcl3500 07-06-2001, 09:08 PM What is the error number? Don grams 07-10-2001, 08:43 AM There is not an error number. I am trying to select a datasource from the properties section. I think I have determined that I have to define it as an object, but I still cannot seem to connect it to a datasource. So far I have this much: Dim MSFlexGrid1 As MSFlexGrid Set .DataSource = DataEnvironment1.rsNames.Fields("Repaired_By").Value I have also tried to connect it to an adodatacontrol like this: set .datasource=adodc1.recordset etc pratim_g 07-12-2001, 12:30 AM Try using the DAO connection method. I think ADO does not work properly with Msflexgrid and also let us know which reference have you taken for the Msflexgrid control. Thinker 07-18-2001, 07:54 AM Have you tried the listbox with the MultiSelect property set to simple or extended? dcl3500 07-19-2001, 10:19 PM I don't know if this is exactly what you are looking for but this will fill a listbox for you using ado. make sure the path in the connection string is correct and modify the sql statement to what you need and it should work. It worked for me. Private Sub Form_Load() Dim rs As New ADODB.Recordset, sql As String, sCnStr As String ' 'This connection string for some odd reason should be continuous with no line continuations. ' sCnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data " _ & " Source=f:\Program Files\Agency\Data\AgencyClient_BE.mdb; " _ & " Persist Security Info=False" ' sql = "SELECT Name, HPhone " _ & " FROM tblClient " _ & " ORDER BY Name ASC;" ' rs.Open sql, sCnStr, adOpenKeyset 'Edited Do While Not rs.EOF With List1 .AddItem rs.Fields("Name").Value rs.MoveNext End With Loop ' With List1 ' .MultiSelect = 2 apparently multiselect can only be set at design time so if 2 = extended mutilselect in the property window .ListIndex = 0 End With End Sub If you want it in dao I can show you that to (it is faster.) Don Time is the best teacher; unfortunately it kills all its students.<P ID="edit"><FONT class="small"><EM>Edited by dcl3500 on 07/19/01 11:46 PM.</EM></FONT></P> Robby 07-23-2001, 06:18 PM If you want, you can use a simple ListBox and set the property "Style" to "CheckBox", this will allow the user to check or uncheck as many items they want. Then you can even set the number of columns. BUT, adding items to a listbox requires looping through the database. |
EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum