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




Combo Boxes And Database??


This program is search database program...
Two comboboxes,one button, one text box and a DataGrid...
Firtsly,I create two combo boxes, the first one will show table names,and the second one will show field names,and two of them will be shown their information dynamically
I mean when add or delete some tables or fields from database,
the changes will be also shown in two combo boxes,I use ADODC for database...
Secondly, Do you know
another connection type instead of this

Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "Database.mdb"
Adodc1.RecordSource = "TableName"
Set DataGrid1.DataSource = Adodc1

connection string in ADO?
For example DNS="... " usr:...pswrd:...
and one more thing, I have problem with tex box, whatever it includes, string,number or blank,it has to take anything and show a result from tex box,
but I don't know how can I filter strings,number or blank...Thank you...




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Problems With Combo Boxes/Database
I don't know what the problem is exactly I have an Array of comboboxes that people choose items from. One array is for "Parts" the other array is for "Work" The one array works fine, I select an item and it fills in the price, description. The other doesn't
This first code is the code that works

Code:
Private Sub CmbParts_Click(Index As Integer)
Set db9 = DBEngine.Workspaces(0).OpenDatabase(App.Path & "datainventory.mdb")
Set rs9 = db9.OpenRecordset("Inventory")
Do While Not rs9.EOF
For j = 0 To (CmbParts.Count - 1)
If CmbParts(j).Text = rs9!PartNumber Then
TxtDesc(j).Text = rs9!Description
txtPer(j).Text = rs9!RetailPrice
TxtQty(j).Text = 1
Else
If CmbParts(j).Text = "" Then
txtPer(j).Text = ""
TxtDesc(j).Text = ""
txtTotal(j).Text = ""
TxtQty(j).Text = ""
End If
End If
Next j
rs9.MoveNext
Loop

End Sub
This is the code that doesn't. Although sometimes it shows the Amount in the txtamt(g).text field, but it seems to only work when I select the 3rd item on the Combobox list.

Code:
Private Sub CmbWork_Click(Index As Integer)
Set db19 = DBEngine.Workspaces(0).OpenDatabase(App.Path & "datainventory.mdb")
Set rs19 = db19.OpenRecordset("WorkOrders")
Do While Not rs19.EOF
For g = 0 To (CmbWork.Count - 1)
If CmbWork(g).Text = rs19!WorkDesc Then
txtamt(g).Text = (rs19!WorkOrderTime * (RTrim$(InfoFile.HourlyWage)))
Else
If CmbParts(g).Text = "" Then
txtamt(g).Text = ""
End If
End If
Next g
rs19.MoveNext
Loop

End Sub

Help Connecting Combo Boxes With Database
hi

i'm working on a student regisration program. i set some of the fields to be text boxes which can be retrieved from the access database. there is no problem on this.

but the problem is that i made courses & year to be selected from a drop down combo box and drop down list box and so i can not make this selection to be automatically added on the access database field once a user selects it. any one with the idea how to do it? pls help me!

E.

Combo/List Boxes Linked To A Database
Hi Guys

I am a complete newbie at being a newbie and in need of some help from you dear folk.

Im setting up a small application for a Computing Studies project in sixth form. Our aim is to make the software handle different data such as employee data, customer data and stock data for our chosen business. I chose a small music/games shop. I like to keep things basic... see.

Moving on: Ive been through my brain in 1,000 cycles searching for a different way to do an 'Add New Order' form but I can only see justice in using either a combo or a list box to display the different products in a stock table in an Access database. My problem is that Im unable to make the list or combo boxes display the different products inside the stock table. It will show one, then leave the rest blank. Ive tried binding them with a simple data control as well as an ADODC. Its just not working.

From what Ive seen Im about to get flamed for binding objects - but Im not serious programmer so it was the easiest way.

The question without the waffle is: Is it possible to link a combo/list box to a list of different products inside a table? Either using SQL code or bound controls?

If anyone understands what Ive just typed - I would seriously appreciate any bit of help I can grab.

TIA to you all

JG

Reading Data From 2 Tables In One Database Then Dumping It Into Combo Boxes - HELP PLEASE
I am using microsoft access as my database, this database contains two tables 1/email_reference_table and 2/department_reference_table. I then want to read the data from each table into seperate combo boxes.

The problem I am having is that I can read the email reference table data ok but not the department table data.

I have attached a zipped up file containing source code and database.

Can anyone help?

Regard
M

Combo And List Boxes To Text Boxes?
Connecting sub-menus to rich text boxes is fine is most cases but the user does not always want to use menus to load and display text. Applying the same technique as sub menus to text boxes with combo or list boxes just wont work could someone please help me out with this one.

Both combo and list boxes will for example:

Contain an alphabetic list.
When the user clicks on a file it should locate the text file from the drive.
It should then open it into a rich text box on the same form.

Could this be possible?

Please any help will greatly be appreciated.

Help With Combo Boxes And Text Boxes
Hello, I am making a little test program and I want it so I can click on a item in my combo box and that word appears in my text box... any ideas? help please.

Combo Boxes Or List Boxes?????
A bit of a beginners question. Hope it makes sense

I dont know which is the best to use. Here is the problem:

I want some kind of drop down list that allows the user to pick one of 12 items. Then that item is linked to a set of numbers. For e.g. if user chooses the item "A" then this means the numbers 0.025689 and 0.85696 is linked to each. Now do i use a combo or a list item or something else.

In addition what kind of code do you use to enter new items in a combo box or list item box. I tried to use:

ComboBox1.AddItem "A"
ComboBox1.AddItem "B"

within the combo box private sub - but when i play it back the combo box is empty. Any ideas???

Thanks

Text Boxes And Combo Boxes
I am trying to create a system that will allow you to pick a name from a combo box and then other information about the person will appear in labels when a command button is clicked. The problem is, is that i do not know how to get the databar to link the correct information with the labels and with the right name.

Any Help??

Combo Boxes
stupid question i guess but when i created my combo box in my form, the .additem function was not available....

how do i do to add items to my combobox ????
HELP

Combo Boxes.
I am kind of new to vb applications. I took an introductory course, but this is my first foray into production issues. My issue is this. I have 4 combo boxes, all of which share a "pool" of 24 numbers, so that if, for example, you select 5 from one drop down, the other 3 drop down's maximum selectable number goes to 19. I have the boxes updating fine and everything, but the drop down the user selects, instead of showing the value selected, is just empty. The 4 drop downs are in a control array, and when I debug the code, and watch the actual boxes, it stays selected until the end sub line executes, and then the .text field of the box the user was selecting from goes blank.

I won't post any code yet in-case this is a simple issue, also there'd be a bit more explaining about the specifics of the code.

I get the feeling there's some little thing I can toggle, or play with that will fix this, I just don't know what exactly.

Any help would be appreciated!

Pat

Combo Boxes
I have created a form with data on it and have included a combo box. When I select a value in the box, I want the current data to automatically update itself on the rest of the form.

So basically, when I change the combo box (which is a list of college courses, I want the rest of the course details to update with it and show the details.

Any help would be appreciated.

VB Combo Boxes
How do you clear a text box and set it to nothing. I have a command button "Clear" and it doesn't work to set combo box to nothing. I tried cboBox = ""......any ideas?

Combo Boxes
Does anyone know how to loop through all the combo boxes on a given worksheet. The combobox type that is created using the control toolbox.

Something like this

For each CBox in thisworkbook.worksheets(1).xxxxxxx


next


Thanks

Combo Boxes
Hi there I need to add a combo box for every column in row1.

i = Range("IV1").end(xltoleft).column

For i = 1 To i
'combobox add
'name of combo box
'The postion of the combo will be:
'a = Range("A" & i).Left
'b = Range("A" & i).Top
'c = Range("A" & i).Width
'd = Range("A" & i).Height
Next 'i

Any ideas?

Combo Boxes
I have a form with 3 combo boxes, I need cbobox 1 equal to all values in a column in on workbood tab

Cbox 2 I need equal to all values in a column in another tab and cbox 3 I need equal to 5 things.

I need to reference a value from the table based on the choices in the cboxes then multiply and add them together.

I can not find a good reference for doing this.

Can I Do This Combo Boxes?
This may seem pretty basic, but this is the 1st time in six years i have use VB or done any programing (and maybe the last hehe)

Anyway,

I have 3 combo boxes. lets call them 1, 2 and 3.
Like so:

1=========/ (with options A, B, C and D)

2=========/ (coded to drop down i, ii, iii for A -- iv, v, vi for B -- etc. --- 3 options for each in 1combo_1 for a total of 12 possible)

3=========/ (coded to drop down U and V for i -- W and X for ii -- Y and Z for iii --- etc. --- 2 options for each in combo_2 for a total of 24 possible)

Then you click calculate and it does it's thing.

My problem is this:

If combo_1 = A
Combo_2 will only show i, ii, and iii... So lets say we choose ii
Combo_3 will give us W and X.

But If i go back to combo_1 and choose C
The other 2 combos stay the same, I'd like them to go back to default text.
Either upon clikcing the calculate button, or just by changing Combo_1 (before clicking calculate.

I hope that my generic names didn't confuse anyone or make me look like a complete idiot (which i am anyways)

If anyone can spare just a little code to reset the other combos (2 and 3) it would help SO much.

Thanks in advance

Ryan

Combo Boxes
In combo boxes, how do you limit it so that in run-time, only the items within the combo dropdown box is selectable, and the user cannot type in anything they wish in the combo box?

Thanks.

Combo Boxes
I have a combo box which lists the contents of a query. This is a login combo. If a name in the list is not selected when a button is presses a caption tells them to login. However the users can type anything into the combo box. Is there any way of locking the combo box, but still enabling people to click on their designated name in the list.

Combo Boxes Lag
Hi there. I am making a timing critical program in VB6 where events must be triggered and edited in real-time and am having troubles using combo boxes. It seems that when clicking a combo box, there is a lag of a few milliseconds before the options are presented to you which is throwing my timers off. It is a musical application, so there is no way I can tolerate any perceivable lagging. Has anyone else had this problem? Do you know a way around it? Are there more efficient VB components I could use that present a list of options while not using up much space? Thanks for the help,

Daniel

Combo Boxes And VB
Right I will be as simple as possible. Im not that good with VB!!!

I have a combobox in excel that i put in with the form menu in excel - so its not a user form in VB.

I have a drop down list at the moment - with Model A and Model B as the names of each item - linked to cells in a s/sheet

What I am trying to do is that when the user click model A 4 s/sheets which are used for model should appear (these have been hidden). And then when i click model B in the combo box the 4 existing sheets will be hidden and 4 different sheets will appeear.

Any ideas???

Does this makes sense???

Need Help With Combo Boxes
ok, heres the situation

i have combobox1 and combobox2,
box1's items are A, B and C..box 2's are L, M and N...

I want it so that when A in box1 is selected, a new item (O) is added to box 2...also when the selection in box 1 is B or C, O is deleted from box 2

any help would be appreciated, thankyou

Combo Boxes
I am currently creating a web browser. What I want is a combo box for the address bar at the top and when you type in an address, it stores it in the combo box as a "last typed addresses" style. However, I also want it to be stored in the format of the last typed address being at the top of the list.

Does anybody have any ideas about how I could do it?

Combo Boxes
I have 2 Combo boxes and i want to make a code with the If Then Else
Is this possible?

If Combo1.ListIndex = 0 And Combo2.ListIndex = 1 Then
....
End If

This doesn't work in my program. How can I do this?

Thanks

Combo Boxes
Hi, I'm new with visual basic 6, and I have a question.
How would this work

comboBox = ComboBox1 (Basic, Familiar, Advanced)
Label = LblInfo

Now say that I want lblInfo to display "This is for users who've had more than 3months experiance" if familiar in the combobox is selected.

This is what I have so far:

if ComboBox1. (dont know what comes after the dot, or the rest of this) then
lblInfo.Caption = "This is for users who'ev had more than 3months experiance"

End if

Someone help!!!

Thanks

Help With Combo Boxes Please!!
Hi All,

I have a program that works with a camera SDK. Part of the load form process calls to populate a combo box. It creates an index using enumerate the possible settings then populate the combo box. The default value in the combo box is always the top value (alphabetically). What I need to know is how do I make the default setting something else like the third or fourth value.

thanks

Combo Boxes
i have a data bound combo box, and i want the user to be able to search through the list to find a specific entry, since there is a large list. What is the best way to do this?
i have tried to allow the user to enter data at the top of the combo box, and use the change method, but it keeps on bringing back an error, saying that the current record cannot be deleted or undated,
what should i do, for this search function
heres the code
If Trim(dbClientComboStart.Text <> "") Then
'Adodc1.Recordset.MoveFirst
Adodc1.Recordset.Find "ClientCode like '" & dbClientComboStart.Text & "*' "

Need Help With Combo Boxes
Here's what i need help on. I'm trying to make a simple phone book because I'm a VB newb. Anyways I wanna know how do I display information when I click on a certain name. I can't figure it out, so everytime i click on anything on the combo, it displays only one of the names.

So basically, how do I make it so when i click a certain item, it will display info for that item?

Combo Boxes
I apologize to the simplicity of this question I am about to ask. I have just began programming in VB 6.0 and I am accustomed to programming VBA (Access Forms) or ASP (VB script). With Access, if one were to use a combo box you could create two columns in that combo box(column count). One column with a numerical value(id field) and one with varchar value(name field). I am confused because I would assume you would be able to do the same with a VB Combo Box. Could someone please help. Is it possibly to have 2 columns in a combo box like you could do in Access or VBScript.

Combo Boxes
hi everyone.
i have made progress since last time. i have manage to make the item select from combo box available or show on anotner form,
but i am stuck on how to put a value (price ) to the item itself, and this to be recongise to other forms.
thanks you
many thanks to chiefredbull

Combo Boxes
hi also how do you add multiple values to a combo box on VB. (please keep it as simple as possible )
thanks

Combo Boxes
Could someone please help me i am really stuck.

Ok i am creating an interface using vb6.

Ive got 3 combo boxes which are called event, date and venue. What i want to do is filter using these three combo boxes. So if you click on event u can choose say athletics and i want it to show a list of athletics choices which i presume will be in a list box. Then if you click on date and choose a certain date out of the 2nd combo box it filters down the list box even further and the smae for the final combo box. Now im not sure how to do this, maybe I need an array to hold all the data but then how do I filter on it????? I am very new to visual basic so im not too well up on the coding.

Could anyone please help me?? you would be a life saver.

Thanks

Simon..

Combo Boxes
I was just wondering how I could get the value after a user selects something in a list box (using an array or whatever). Also when using a drop down list style combo box How can I set a certin text to appear in the box before something is selected (it appears blank now).

Also when I set the Index property (like an array) 0, 1, 2... for the default value it doesn't seem to work.

Can anyone help?

Combo Boxes
Hi there,
I am fairly new to Visual Basic(hence the dumb question to follow). I have been messing around with combo boxes and was wondering if you could alter the choices in a 2nd combo box by the choice of a first combo box? If what i said was confusing..i'll explain it a tad better..i think i confused myself with that one

I appreciate your help..and am happy to be joining you,
pollox

Combo Boxes
I'm trying to make a combo selection change the text in a text box. This is the code:

Private Sub Combo1_Change()
If Combo1.ItemData(0) Then
ext.Text = "*.bmp"
ElseIf Combo1.ItemData(1) Then
ext.Text = "*.gif"
ElseIf Combo1.ItemData(2) Then
ext.Text = "*.jpg"
ElseIf Combo1.ItemData(3) Then
ext.Text = "*.log"
ElseIf Combo1.ItemData(4) Then
ext.Text = "*.xls"
ElseIf Combo1.ItemData(5) Then
ext.Text = "*.wav"
ElseIf Combo1.ItemData(6) Then
ext.Text = "*.doc"
ElseIf Combo1.ItemData(7) Then
ext.Text = "*.mid"
ElseIf Combo1.ItemData(8) Then
ext.Text = "*.mp3"
ElseIf Combo1.ItemData(9) Then
ext.Text = "*.rmi"
ElseIf Combo1.ItemData(10) Then
ext.Text = "*.txt"
ElseIf Combo1.ItemData(11) Then
ext.Text = "*.wpd"
End If

But it doesn't work. The combo box looks fine, but the ext.text doesn't change!!

Any tips?

~Complex Solutions to Simple Problems!!~
CornEmpire Ruler
http://www.cornempire.com

Combo Boxes Help
I'm trying to write a program that uses combo boxes and I'm wanting for when a selection in one combo box is made, it changes the list available in another combo box. Like if A is picked in Combo Box 1, Combo Box 2 Shows List B. But if I pick B in Combo Box 1, Combo Box 2 Shows List C. And so on. And I'm trying to do this without having to click on any Command Buttons. Like it'd be automatic. If that's even possible. Thanks.

Combo Boxes
just a few queries about combo boxes

1) i want to be able to put the selected combo box text into a string, how can i do this?
2) is it possible to have a combo box operating like a dropdown list, however, with an initial caption...ie. Please Select User

thanks )

Combo Boxes
im very new to visual basic and am a student. i can't figure out a few things, and any help would be greatly appreciated.

-i have a case in my combo box, and i need to call a calculation but im not sure how to set it up.... i have
Call calEntree
and a public sub procedure calEntree with my calculation statement.
how do i get the calculation sent to a text box from this call statement? thanks for the help.

Combo Boxes
Is there any way of having a combo box with each item having a bmp (or any other picture file) next to the text ?
I want the user to tell the program what the wether is like !
Sunny & (Picture Of Sun)n etc.

Tanks in Advance

Combo Boxes
Hi I'm using a combo box to limit a users input choice to fields in a database, i've managed to populate the combo box with field names using combo1.add (rsPRODUCT_GTOUP!Name) but when the user selects a option from the combo list I want to obtain information, Ideally I would like to attatch an ID to each item in the combo box, as well as a name ! any ideas ?

Thanks

Matt

Combo Boxes
Hi I'm using a combo box to limit a users input choice to fields in a database, i've managed to populate the combo box with field names using combo1.add (rsPRODUCT_GROUP!Name) but when the user selects a option from the combo list I want to obtain information, Ideally I would like to attatch an ID to each item in the combo box, as well as a name ! any ideas ?

Thanks

Matt

Combo Boxes?
How do you say if the displayed combo box is so and so then do this. This is what I did but it doesn't seem to work?

If Combo1.SelText = "Length" Then
Label5.Enabled = True
End If

Combo Boxes
Could some one please tell me how you make the list in the box to change if you e.g. press a button...
In my game that I'm programming the box is the item list, and if you get e.g. a potion, potion should be in the list... Can't really explain better, hope you'll understand!

Thank you all.

Combo Boxes
in Visual Basic, i need to find some info on these cos i need to do them in an assignment and our teacher hasn't shown us how to use them. if anyone has any links or can straight up just tell me how to use, that would be good.

cheers
coxman

Combo Boxes
Hey

I need to populate a combo box from a database. Ive tried this:

combo1.AddItem (frmCurrent.datRecord.RecordSet.Fields("FIELDNAME"))

However, this only seems to add the top one of the records.

Do i need aloop to do all the records or is there an easier way?

Combo Boxes
Hey

Im doing a program where I can click in a combo box and select an artist. Then a second combo box appears displaying the albums of that artist that I have on my computer.

Now, when the Artist combo box is clicked, the album combo box has a variety of ".AddItem" of that artists tracks.

This works fine. However, when I change the artist the previous selected artist track are still in the second combo.

I have looked into the ".RemoveItem" but it springs errors up when changing the combo box.

Any help would be grateful.

Thanks

Combo Boxes
I have a slight problem.

I have three combo boxes on my form, they have had the style property chaged to make them simple drop down lists.

Now I have code to detect when a new value has been selected.
What I would like is when I select a value in combo box A, Combo Boxes B and C should go back to having nothing selected.

I can do this very easily if I change their styles back to Combo again, but would prefer to keep them as Dropdowns.

Anyone any ideas?

Combo Boxes
Guys and Girls,
I am in the middle or converting a Microsoft Access 2000 Database project to a full Visual basic 6 application. All is going well except for one thing. I can't seem to duplicate the combo boxes in access. That is when you populate a combo in access and star typing within it, the box sort of auto predicts and starts bringing up the most likely choice based on what you have already typed. Any ideas how I can do this in VB??

Combo Boxes, How To...?
Okay, simple question really. Did a search but couldn't find a simple 'how to' for my situation.

What I basically want to know is how can I make it so if a certain selection from the 'List' is selected, it'll then do something unique, like show another form.

Simple question really, but don't know how to go about it.

Thanks

Ant

Combo Boxes :-)
I need to adapt a formula so that the constants in it have different values, dependant on the category in the combo box. Have never used Visual Basic before and dont have a clue!

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