Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Fill 23 Combobox With The Same Info


hi!, look i have a form that contains 23 combobox, all with the same info (blaxk, white, ...), a now i can do it in like this


Private Sub UserForm_Initialize()

ComboBox1.AddItem "black"
ComboBox1.AddItem "white"
ComboBox1.Value = "choose"

ComboBox2.AddItem "black"
ComboBox2.AddItem "white"
ComboBox2.Value = "choose"

ComboBox3.AddItem "black"
ComboBox3.AddItem "white"
ComboBox3.Value = "choose"
.
.
and so , and so, but come on, there ir other way to do this. plz can u help me




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Fill ComboBox With 'drive-like' Info
I read most of threads pertaining to using code to select folders versus files. Specifically using the API calls BrowseForFolder and the CommonDialog. Below is an image I'd like to recreate in code. Specifically, filling the ComboBox with the drive information. I believe if I could get that far I could get the rest.

http://www.bluerivercofc.org/images/combobox.jpg

Any assistant would be greatly appreciated.

--Gary

Trying To Fill Form With Info From Recordset
Hi all
I'm trying to find a way to fill in a form (frmModifyProducts) with the results from frmProductSelector.
My specfic question relates to the With frmModifyProducts portion of the code below, how do I reference the correct fields for the product where !fldProductID = strUPCToModify?
Thank you
Cheers


Code:
strUPCToModify = Mid(Tag, 1, 1) & Format(cboSelection.ItemData(cboSelection.ListIndex), "0000")

With deHighSpirits.rscomProducts
.Open
.MoveFirst
Do While Not blnFound
If !fldProductID = strUPCToModify Then
blnFound = True
End If
.MoveNext
Loop

End With

With frmModifyProducts
.Tag = Tag
.Caption = "Updating Information to Database (Category: " & Tag & ")"
.lblUPCData.Caption = deHighSpirits.rscomProducts!fldProductID
.txtName.Text = deHighSpirits.rscomProducts!fldName
.cboCountry.ListIndex = mintCountry
.cboType.ListIndex = mintType
.cboVolume.ListIndex = mintVolume
.txtPrice.Text = Format(deHighSpirits.rscomProducts!fldPrice, "0.00")
.Show vbModal
End With
Set frmModifyProducts = Nothing
deHighSpirits.rscomProducts.Close

End Sub

Fill In Keyboard Info Into MSFlexGrid
Dear VB users,

I am trying to fill a MSFlexGrid cel with my keyboard.
The only thing I can do is to fill this cel with the "KeyPress event"

Is there a more easier way to fill a cell directly from the keyboad?

Is there a special property to do this??

Nice regards,

Michelle.

Fill Info And Print A Pre-formated .rtf File
Hi,

I have developed an auto renting application and now at the point where I am trying to print the actual contract. I have created the contract using MS WORD and saved it as an .rtf file that I am attatching it here. I want to know how to use this file in my VB application. I have never done this before. If someone can tell me how it is done or guide me to a post that has any sample so I can learn.

I think I have to enter some unique combination of characters in all those places where the information needs to be filled by the application and then bring this file in an RTF box and find/replace the unique characters and the print. But the problem is I don't know how to bring the file in the .rtf box or find/replace. Basically never done this.

I am looking for some sample code so I can learn myself. Any help will be greatly appreciated.

Sincerely.

Fill Datagrid With 1 Sql Statement With Info From 2 Tables
Here is the situation.

I have
TABLE1 with field Field1, Field2
TABLE2 with field FieldA, FieldB

I want to make a select in both tables to fill a datagrid. The datagrid will have 2 column: Status and Nb

In column Status i want values of field ( Field1 and FieldA ) which contains same type of value both in 2 different tables.
In column Nb i want a count of field ( Field2 and FieldB ) ........

Separately it would be
"SELECT COUNT(*) AS NB, FIELDA as Status From TABLE1 GROUP BY FIELDA"
"SELECT COUNT(*) AS NB, FIELD1 as Status From TABLE2 GROUP BY FIELD1"


How to get the same result but in only 1 sql statement ? hope its clear enough



Edited by - Shandy on 4/22/2004 8:58:28 PM

Combobox Fill In
how can you make a combobox fill in with the records from an access data base?
example:when you have A database with table students and you wanne add 1 new you can only add 1 to a clas who realy is, and i want a combobox with the classes .

Fill A Combobox
Hi all,

I wanna fill a combobox with a range of cells that contain some characters.
Some of them are subscript or superscript.
That I want to do, is to fill the combobox preserving the format of the characters in the original cells.
Now I am using the following code to fill my combobox named ZoneList but I am sure it misses something for that I want.

For i = 1 To 10 Step 1
ZoneList.AddItem Sheets("Feuil1").Cells(i, 1).Format
Next i

Thank for your help
Defré.

Fill Combobox
Hi,

When I load the form, I want to load all zipcode table into the cbx but I want to leave the zip code of the first client selected. And when I change client I want to change the cbx text value.

any idea?

thanks

Fill 2nd Combobox
I have the following code for my fost combobox; CODEPrivate Sub Userform_Initialize()

    Dim ws As Worksheet
    
    Set ws = Worksheets("Employees")
    Set MyRange = ws.Range("A2", ws.Range("A150").End(xlUp))
    
With Me.Employee
.RowSource = ws.Name & "!" & MyRange.Address
.ListIndex = 0
End With

End Sub

How To Fill Combobox ?
What I try to do is:
1. I have a form with many "combobox"
2. I have a text file with two strings at each line, the first is the "combobox" name, and the second is the value that I would like to add to this particular combobox.
3. I read each line from that text file
What I am asking is: how do I "additem" to the combo which name is the first string and the text that should be added is the second string.

Fill More Then 0ne Combobox In A Userform
Hello.

I'd like to fill 4 comboboxes on a userform. The problem is i don't know how to loop through the 4 combobox object.

Thanx in advance.

Werner

my code:

Code:
Private Sub UserForm_Activate()

Dim cmb As ComboBox
Dim cmbo() As ComboBox

fileGrootBoek = "C:XXXXXurenverantwoordingGrootboek.xls"
qry = "SELECT nr, grootboek FROM `Grootboek$`"

'get a handle on all comboboxes
For Each cmb In frmGrootBoek
Set cmbo(i) = cmb
Next

'counters
i = 0
j = 0

'Fill form with values from excel sheet
Call test

'Execute query
Set result = Gegevens.QrySelect(fileGrootBoek, qry)

'Fill comboboxes wich are named: cmbGB1, cmbGB2, cmbGB3 and cmbGB4
'First empty combobox
For Each cmb In frmGrootBoek

cmbo(j).Clear

'code to fill combobox
Do While (result.EOF = False)

cmbo(j).AddItem (result.Fields(1))
cmbo(j).List(j, 1) = result.Fields(0)
j = j + 1
result.MoveNext

Loop

Next

'close recordset
result.Close
Set result = Nothing

End Sub

Fill Combobox From Listview
I've got the Problem that I need to "copy" a column out of a listview-field into a combobox.
It's working that far, but I'm doing it in two steps. At first I copy the values from the listview to a worksheet and in the second step I fill the combobox with the help of Rowsource.

Is there any posibility do this easier in maybe one single step?

EDIT: I've found the solution... was just to blind to see it directly. I'm just getting started with VBA programming

Fill Combobox With Query
I have filled the values of my combo box with a query from an access database, and have been unable to figure out how to let the combo box allow other values typed in. If it is not included in the query, I cannot type the value in. I have played around with the properties with no luck.

Can I Automatically Fill In A Combobox?!?!
I have a combobox and the list comes from an access file. I want to have it so when the user tabs onto the combobox and starts typing the closest match would come up with a blue backround and if the user tabs over again it will fill the combobox. I know I have to do it in the change event and change the backround color but I'm just need to be zapped with a defribulator to my brain..... any ideas I'll try to figure it out until then... but any help will be appreciated

Fill Array From Combobox
I am currently writing a program which I cant seem to quite finish.. I fill a combobox with multiple lines, consisting of 5 elements delimited by commas. I then am trying to write them separately to a text file which I am using in another program. I think the best way to do that is to store the combobox contents to an array then to a text file.

currently looks like this in the combo box

Bagatelle, Beethoven, Piano Sonata, THIRD, 7
Seven Garden, Motzart, String Symphony, FIFTH, 2



I need it to look like this in the text file

Bagatelle
Beethoven
Piano Sonata
THIRD
7
Seven Garden
Motzart
String Symphony
fifth
2

Use ComboBox To Fill In Other Fields?
I either don't understand ComboBoxes or I just don't know what they can't do.

I have a ComboBox (cboOdds) with a prefilled list of 8 options that will never change (I am using Style "2 - Dropdown List"). I want to be able to select one of the items in the list and have this immediately fill a text box (txtOdds) with text connected to that item in the list. If I then select a different choice from the ComboBox, the information in the text box will be changed to the new information connected to the second item and so on.

In short, turning the ComboBox into the trigger for a text box auto-fill.

Fill Combobox With Records...
assuming i have a mdb Mymdb in a server dir \myservermydirMymdb.mdb in this mdb have table_01 with field Test_01

i would want to fill the combobox1 with the records in Table_01...
Naturally fill the combobox1 wothout balnk records...
how can?
Tks.

Using SQL To Fill A ComboBox [SOLVED]
Hi all!

I'm using this code below to add the content of the first column (CHP) of my database to a ComboBox. I'm not a sql-Expert, so I would like to ask how I add the first and the second column (NCHP) to this ComboBox (in one row: Combo1.Additem Column1 & Coulmn2).



VB Code:
Dim db As Database        Dim rs As Recordset        Set db = OpenDatabase(TOURENWF.F4UG5T02.Text)        Set rs = db.OpenRecordset("SELECT CHP, Count(CHP) As InitCount FROM Tab1 GROUP BY CHP")        Do Until rs.EOF            Combo1.AddItem rs!CHP             rs.MoveNext        Loop        rs.Close        db.Close


Hope u understand my problem!
thx, Matt

Fill A ComboBox With Fonts
Hi all,

hoe can I fill a ComboBox with all Fonts that are available at the system ??

CU
Kreuzfeld

Fill Combobox From Database
I have an Access dataBase and need to fill a ComboBox with the contents of a specific field, I'm just trying out database stuff so be gentle with me.

I can get all the field into textbox's and advance through them add, delet ect but I've been up since 3.30
this morning thinking obout it.

The DataBase is called Mailing and the filled is called Email. I know Boring names but what the Hell.

Fill A Combobox From A Textfile?
I want to fill a combobox with each line from a txt file. For example the text in mytext.txt looks like:

Adress 1
Adress 2
Adress 3


I want to add this 3 lines in to my combobox, how?

Database ? - Fill A ComboBox
How would I go About using ADO to fill a combo box...

I am using this...(but somehow i think it could be done a little better )

rs.MoveFirst
Do While Not rs.EOF
cmbID.AddItem rs!reqID
rs.MoveNext
Loop
rs.MoveFirst


reqID is the field name...

Creating Sub To Fill Combobox. Help
Hi all,

I have a sub which I want to call to fill a combobox. But it doesn't work. Here's the code:
---------------------------
Sub AddListItems(cmbname As ComboBox)

Dim sTemp As String
cmbname.Clear

Open (App.Path & "list.txt") For Input As #1
While Not EOF(1)
Line Input #1, sTemp
cmbname.AddItem sTemp
Wend
Close #1

End Sub
----------------------------

For example when the combobox I want to fill is named cmbStuff, I would call it AddListItems (cmbStuff)

It should work right? But it doesn't. It gives me type mismatch.

If I replace the line
"Sub AddListItems(cmbname As ComboBox)"
with
"Sub AddListItems"
and change all the "cmbname" with "cmbStuff" in the above code, and call the simply by AddListItems, it works FINE.

Where is my mistake? Thanks in advance for any help.

Martin

How To Fill 3 Combobox With The Index....
assuming i have combobox1, combobox2, combobox3 ho to fill( in initialize form) all combobox with unique item in this mode:

combobox1 column D
combobox2 column H
combobox3 column L

and use the cmobobox2 similar index...

Example:

if i select in comobox2=SEGNO SALDO ANOMALO
auto fill comobox1=150001059999
auto fill combobx3=4500

if i select in comobox2=SEGNO IMPORTO ANOMALO
auto fill comobox1=150008040030
auto fill combobx3=4500

ecc...

in effect auto fill other combobox based combobox2






Edited by - Geof on 2/24/2007 7:50:54 AM

How To Fill A Combobox With Available DSN Entries?
How to fill a combobox with available DSN entries?


Initiative is to success what a lighted match is to a candle...

Combobox List Fill Range
I have a spreadsheet with three comboboxes. The first combobox lists whether or not the wood beam is sawn or glue laminated (for example). The second combobox lists the species of the wood (oak, cedar, etc.). The third combobox lists the available grade (stud, utility, etc.). All 3 comboboxes are based on a fill range within the spreadsheet and all three are written with VBA code. My hangup is that there is a situation when the wood beam size is based on a different fill range.
Is there a way to get excel to recognize something along the lines of:

If combobox2.text<>"Southern Pine" or "Mixed Southern Pine" then
combobox6.listfillrange="AI2:AI9"

I know this can be done with data validation but I would prefer to use VBA.

Fill A Combobox Via VBA With Directory Names
I was searching in the archive of this forum, but i never saw a good answer to my question.
What i like to have is, that when my sheet is loaded, automatically fills a ComboBox (/drop down list) with all directory names, in a specific directory (e.g. look in c: est and if there are directorys in it, show them in the combobox).

I am aware of the excell method, to place the founded values in a cell, and with a linked cell and linked range, i can show the values in the list. But i don't want to do that, i want that vba fills that combobox.
a>is that possible
b>is it possible to do that on load.
The object combobox is never been accepted as an object, except in the sheet code itself.
anyone?

Fill Combobox With Results Of Findnext
Hello,

I have a number of sheets, all containing football team names.
I run a find macro based on a a text string; this only finds exact matches. If no exact matches occur, I need a combobox populated with all the results of another find search; this time an (xlpart) search. All the nearest matches need to be shown, with an option to pick the correct one. e.g Let's say I search for "Man"; I would like a box populated with "Manchester United", "Manchester City", "Mansfeild", etc.

If anyone has any code, or previous experience of such a problem I would be most grateful.

Cheers

H

Auto Expand/Fill In ComboBox
I am looking for a way to "auto fill" a combo box as the user types.
For example, if the combobox contains "ab, abra, abraca", "ab" should appear as soon as "a" is typed, then "abra" as soon as the "br" is added, etc.

MSAccess has this feature in the ComboBox Properties called "Auto Expand." I found in a reference book that Style = 1-Simple Combo is supposed to do that (called Extended Matching) in VB6. However, it only works if the user presses the down key after typing the first few letters.

Finally, I found some code at http://www.xtremevbtalk.com/show...ended+matching which is supposed to do that.

Is there any easy way/setup to achieve this?

Thanks!
hervé Chain
Houston, Texas

Auto Completen ComboBox + DB Fill...
Ok looking for the control for an autofill combobox

I am accessing a database doing so

VB Code:
Private Sub searchLname()Set rs = New ADODB.RecordsetDim SQL As StringSQL = "Select Lname from userTable"[b]rs.Open SQL[/b] [i]'choking here[/i]Do While Not rs.EOFuComboLname.AddItem rs!Lnamers.MoveNextLoopEnd Sub


Runtime error COnnection is either closed or invalid

Is my open line wrong?

My end result should be to fill this combo box with all the last names of people, and when the user is searching for a user it should autocomplete based on that list in the combobox.

Thanks

Fill Combobox With Data And 1 Option All
Hi

How Do I fill a combobox with the data from query and an option all ?

thank you in advance

Fill TextBox Linked To ComboBox (Access)
It's been awhile since I've used Access, so bear with me.
I have a combobox that is linked to Column A in Table A. When the user selects something from the combobox, I want the associated information in Column B in Table A to fill a TextBox. Also, if I make changes to the information in the TextBox, I want that to replace what was there. Is this possible (I'm assuming it is)? Is it done through a Macro or VBA (or other???)? Thanks in advance!!

With ComboBox Changing Fill Color Ellipse
Hello,

I am a starting VB programmer and i've got a little problem.

My goal at this moment is maybe very simple, but I just don't have the knowledge (yet) to know to solve this.

I want to change the color of my ellipse by selecting a value from a ComboBox2

ComboBox2 contains the names of the colors like Firebrick, Red, bla bla.

The problem is indicated at the bottom of my script. I've tried some things, which should be logical for me, but the don't work.


Code:
Private cCircleColor = Color.Brown 'my ellipse color var

Sub flips(Optional ByVal e As System.Windows.Forms.PaintEventArgs = Nothing)
Static varE As System.Windows.Forms.PaintEventArgs
If Not e Is Nothing Then
varE = e
End If

varE.Graphics.FillEllipse(New SolidBrush(cCircleColor), iX, iY, 25, 25)
End Sub 'flips

Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
cCircleColor = Color.(ComboBox2.SelectedItem)
' ^^ This is the part
Call flips()
End Sub
Hope someone can help me 'ere

Fill TextBox Linked To ComboBox (Access)
This is a repost from a posting I did in the VBA forum. I wasn't sure if I needed to ask it there or here...sorry.

It's been awhile since I've used Access, so bear with me.
I have a combobox that is linked to Column A in Table A. When the user selects something from the combobox, I want the associated information in Column B in Table A to fill a TextBox. Also, if I make changes to the information in the TextBox, I want that to replace what was there. Is this possible (I'm assuming it is)? Is it done through a Macro or VBA (or other???)? Thanks in advance!!

[solved] Fill Combobox With Database Values
Hi,

I have the following tables in a Access 2000 database:

tab_employee
---------------------
ID
name
department (number)



tab_department
---------------------
ID
department


Now I have created the following recordsets:


Code:
rsEmployee = "
SELECT * FROM tab_employee, tab_department
WHERE tab_Mitarbeiter.department = tab_department.ID"

rsDepartment = "SELECT * FROM tab_department"


Now I fill a a formular of Employees with my rsEmployee and put a Datacombobox with the Department on the formular:


Code:
Set dcombo.RowSource = rsDepartment
dcombo.ListField = "Department"


I get a problem when I´d like to show the department of an employee in the Datacombobox:


Code:
If Not IsNull(rsEmployee.Fields("department").Value) Then dcombo.Text = rsEmployee.Fields("department").Value


Because I can´t readout rsEmployee.Fields("department"). But when I test my SQL statement of the rsEmployee in Access it runs...Can anybody help me?

Thank you for all considerations,

Andy

Module Level Combobox Fill Routine
Hi all. I have a quick question. I think this should be simple, but I can't get it to work. Throughout my app, I have a number of combo boxes that display all of the US states. The states are loaded from a database, and I'm trying to write a module level procedure that I could call to fill the state combo boxes when I need to, but I cant' get it to work. Any suggestions?

Thanks

FLL

Fill In Textbox Based On A Combobox Selection
I am connecting to an Access DB using ADODB from a VB6 application. I can connect to the DB, and create recordsets. What I need a bit of help with is:

I want a text box to automatically be filled in with a field (field=Location) after the user selects an item from a dropdown box (field=iPAQ). The two fields are in the same table (table=iPAQs) so the two fields would be from the same record. I just want the text box to be automatically filled in.

Here is how I make the recordset for the iPAQs table:
Code:
    'Loads iPAQs table into rsiPAQs
Set rsiPAQs = New ADODB.Recordset
With rsiPAQs
    .ActiveConnection = cnMHS
    .CursorLocation = adUseClient
    .CursorType = adOpenStatic
    .LockType = adLockPessimistic
    .Source = "SELECT * FROM iPAQs"
    .Open
End With


Then I load the records from the iPAQ field into a combo box (CboiPAQ) using:
Code:
    'Fill the iPAQ Combobox
Do Until rsiPAQs.EOF
    CboiPAQ.AddItem rsiPAQs!iPAQ
    rsiPAQs.MoveNext
Loop


I hope I explained that all OK.
Thanks for any help or pointers anyone can provide!

Ray



Edited by - rjholtz on 6/1/2005 7:22:14 AM

(solved) Fill Combobox Based Sheet...
I have a form with 4 tab named with the sheets in workbook...
Now how to fill if i click on tab CORPORATE the combobox1 with the data in sheet CORPORATE with the jlon of column A " - " & " colum B &" - " column C
example:

  OI26710    - ARENA DOMENICO - RESP1
  OI29651    - CALCAGNILE ETTORE - RESP1
ecc...


... and combobox2
  
with the data in sheet RETA__POE with the jlon of column D " - " & " colum E &" - " column F
example:

OI32227- CARILLO VINCENZO - RESP2
OI29651- CALCAGNILE ETTORE - RESP2

ecc...

naturally if i click on tab RETA__POE use the value into this sheet t RETA__POE to fill the 2 combobox...

hope you understand me...



Edited by - luca91 on 12/28/2006 4:40:05 AM

Fill A Combobox From Table In Mysql Database
Hi,
I'm sure this question has been asked before but I couldn't find an occurence of it.

I've got 2 comboboxes on a form and I'd like to fill them from a table in a mysql database. Any advice on how this should be done?

Thanks,

Mag2

Findnext Using Info From DB Combobox
hi, im wondering if you can tell me why this wont let me search for the next record containing the string taken from the Combobox, i have tried nearly everything and only last thing i can think of is that the user names have a space i.e. first name space lastname, would this stop the search?, any help would be great, thanks


Code:

'check for blank member else set the videos recordset membershipno to member no
'from the customer recordset
Dim customerinfo As String
customerinfo = dbcChooseCustomer.Text
If customerinfo = "" Then
MsgBox "Please Choose A Customer", vbOKOnly, "Message"
Else
datVideo_Customer.Recordset.MoveFirst
datVideo_Customer.Recordset.FindFirst "name = " & customerinfo 'problem is here error - syntax error(missing operator)?
datVideo_Video.Recordset.Edit
datVideo_Video.Recordset("membershipNumber") = datVideo_Customer.Recordset("membershipNumber")
datVideo_Video.Recordset.Update
End If

Adding Database Info To A ComboBox
One of my database tables is called books. One of the fields of "books" is called title. The data object i use is called datBooks. Whenever my form loads I would like to have ALL of the elements under the field of "title" fill up a combo box.

This way, when the user decides to pick a certain book he or she will have a list of books to look at as opposed to just shifting through the database with the data object. How do i get this done?

Retrieving Info Using ComboBox Input
Good Morning!
I was hoping someone can help me! I am working on a project and have hit a snag. I have a database form set up where a user can browse through and update records. I wanted to set up some sort of control that would allow the user to pick which record they wanted to look at instead of going through each one individually.

I set up a combo box that I populated with four columns of information for the user to see and choose from. One of the columns is a subscript field that I was trying to pass into a SQL Query to populate the text boxes on the screen. However, I can't get it to work. Here is some of my code.

Private Sub Combo3_LostFocus()
Dim sString As String
Dim sString2 As String
Dim sString3 As String
Set cnCapco = New ADODB.Connection
Set rsResults4 = New ADODB.Recordset
cnCapco.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:Program FilesMicrosoft Visual StudioVB98Capco.mdb"
cnCapco.Open
sString = Combo3.Text
sString2 = Mid(sString, 15, 2)
sString3 = Val(sString2)
SQLQuery = "SELECT JobNumber, ItemNumber, Description FROM ItemBreakdown WHERE DescSub = sString3"
rsResults4.Open SQLQuery, cnCapco

txtFields(0).Text = rsResults4(0)
txtFields(1).Text = rsResults4(1)

Any help would be GREATLY appreciated!

Kristen

Selecting Field Info From A DB Via Combobox
Hi,
So I'm trying to make a register-type programs that allows the selection of menu items from combo boxes. After a user changes a combo box selection I need the price for the newly selcted item to be displayed in a textbox. I have been trying to get this function to work by connecting to my DB through code (M$ Acces 97, jet 3.51, using ADO) but it is not working. Now I've been trying to select menu records by using a ADODC and linking the relevant textboxes to the ADO DC in order to see if the code Im using is even finding any menu item records...it isn't. I'm kinda at the end of my rope here, I've been trying anything and everything to try and get this working, can someone please point me in the right direction?

Code:Private Sub Combo1_Change()

With mcnConn
        .ConnectionTimeout = 25
        .Provider = "Microsoft.Jet.OLEDB.3.51" ' *** ACCESS
        .Properties("Data Source").Value = "C:Program FilesMicrosoft Visual StudioVB98Giacone.mdb"
        .Open
End With
Dim strSQL1, strSQL2, strSQL3, strSQL4 As String
Dim selection As String
Dim rs7 As New ADODB.Recordset
selection = Combo1.Value

'strSQL1 = "SELECT * FROM PizzaMenu WHERE Pizza LIKE '" & combobox1.Text & "%' "
'rs7.Open strSQL1, mcnConn, adOpenDynamic, adLockPessimistic, adCmdText
   
Adodc4.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=C:Program FilesMicrosoft Visual StudioVB98Giacone.mdb"
Adodc4.RecordSource = "SELECT Price FROM PizzaMenu WHERE Pizza =" & "'" & Combo1.Value & "'"
Adodc4.CommandType = adCmdText
Adodc4.CursorType = adOpenKeyset
Adodc4.LockType = adLockOptimistic
Adodc4.Refresh
 
    If rs7.State = adStateOpen Then
        rs7.Close 'Close the recordset
    End If
Set rs7 = Nothing

    ' **** Close Connection to DB if open ****
    If mcnConn.State = adStateOpen Then
        mcnConn.Close
    End If
    ' **** Clean connection object from memory ****
    Set mcnConn = Nothing

End Sub

Storing Input Info From A Combobox To An Array
Hi all,

This might be a real simple question, but I'm afraid I'm unsure of what I'm missing / doing wrong.

I have a custom dialog box that allows the user to enter the group number of some info using a combobox. The program loops through this process a specified number of times. However, through displaying array values using a Msgbox, i realised that these values input by the user using the combobox are not being stored to the array. Why would this be?

My (edited) code is as follows:


Code:
ReDim MCPgroup(1 To lastrow)

For j = 1 To (lastrow - 6)

Load frmelectrical
frmelectrical.Show 1
MCPgroup(j) = frmelectrical.cboMCPno.Text 'assign combo box value to MCP array

Next j

For j = 1 To (lastrow - 6)
MsgBox MCPgroup(j)
Next j

Thanks in advance for any help you can give!

Subclassing A Combobox To Get The Info Regarding The Items In The List
Help me out,
See, I am making a program to get the controls and there property and the data from another running application (window).
The problem is with the comboboxes. I cannot retrive the items in the list. On going through the text in MSDN that, if a combo or listbox is made without HASSTRINGS than the GETTEXT will return a 32bit pointer to a table. Also during the use of FINDSTRING, SELECTSTRING a WM_COMPAREITEM is sent to the owner window with Lparam pointing to the COMPAREITEMSTRUCT structure.
Now the help required is - how to implement and retrive the above.

Change Info Displayed By Combobox Depending On Record Selected
I am trying to change the info displayed by a combo box depending on record selected.

Combobox defaults (.listindex = 0) to 'Family'.

User clicks on next button.
How do I get the combobox to change to 'Young Adult' (.listindex = 7)

I assume I need a loop of some sort but not sure which one (Do Loop, For/Next)

Thanks for your help.

Fill Combobox List With List Of Unknown Length
right now i am populating the combo box list like this :

Sub LoadApps()
cmbApps.ListFillRange = "Extras!A11:A12"
End Sub

However the list could grow and it could to A11:A100

is there a way to select from A11 until the last filled in cell in column A?

Fill Listview Then Double Click To Fill Text Boxes (Resolved)
Hello

I have been working on this project off and on for about 6 months. What I am trying to do is use a text box search and fill a list view with the results. Then select the one I want and have it populate some text boxes on another form. all the fields can contain alpha numeric characters. I have attached the program. If any one can help me it would be greatly appreciated. I have been trying various combinations but have had no success.

Thanks
Bob



Edited by - Bob Taylor on 7/29/2003 4:08:49 PM

Trying To Fill Up A Felx Grid. But It Wont Fill
Hi im trying to write some code for a flex grid to display the ContactMethod and then Contact information.
they come from different tables.
but i have a nice sql for it and it wont fill in at all. it just displays blank boxes every time.

i have on my form load to call in this order
FormatGridBefore
FillGrid
FormatGridAfter

heres the codes:

Private Sub FillGrid()
strsql = "SELECT tblALLcommunication.CommMethod, tblEMPLOYEEcontact.Connection FROM tblALLcommunication INNER JOIN tblEMPLOYEEcontact ON tblALLcommunication.CommID = tblEMPLOYEEcontact.CommID"
Set rs2 = New ADODB.Recordset
rs2.Open strsql, cn, adOpenKeyset, adLockOptimistic, adCmdText
Set flexcontacts.DataSource = rs2
flexcontacts.Refresh
rs2.Close
Set rs2 = Nothing
End Sub

Public Sub FormatGridAfter()
With flexcontacts
.ColWidth(0) = 1520
.ColWidth(1) = 1520
.ColWidth(2) = 3037
End With
End Sub

Public Sub FormatGridBefore()
flexcontacts.FixedCols = 0
End Sub

Copyright © 2005-08 www.BigResource.com, All rights reserved