Changing Text Box into Combo Box

Crash1hd

Registered CyberGeek
Local time
Today, 07:08
Joined
Jan 11, 2004
Messages
143
Ok on to the new adventure attached is a db file that contains all the information what i need to do is change EnhStoreSellTxt and EnhStoreBuyTxt
into combo boxes so that when the first 2 combo boxes are selected the EnhStoreSellTxt or EnhStoreBuyTxt shows all the stores at that price in the table! :) I gues what I am asking is how to grab data from a table useing vb and then putting them into a combo box dynamically and hopefully not useing a query! :confused:

P.S. If you are wondering what the form does choose Damage 1 for the first 2 combo boxes and you will see the results :)
 

Attachments

Last edited:
Im not I figured it could be done with an sql statement in the vb code as you noticed that for it to get the right data it needs 3 requirements that the enh name level and value all match and then list the stores that have them at that price ext...
 
I haven't looked at the db. Unless you post a 97ver I can't open it
 
Well I only have 2003 and I dont know how to save it as a 97 version or I would! however The code in the vb part of the form is below

Code:
    If Me.Enhnamelist <> "" And Me.enhLevellist <> "" Then

'Price to Sell At
        Me.EnhPriceSellTxt = _
            DMax("enhpricesell", "enhancements", "enhname = '" & Enhnamelist & "' AND " & "enhlevel =" & enhLevellist)
        If Me.EnhPriceSellTxt <> "" Then
'Store to Sell At
            Me.EnhStoreSellTxt = _
                DMax("enhStore", "enhancements", "enhname = '" & Enhnamelist & "' AND " & " enhpriceSell =" & EnhPriceSellTxt & " AND " & "enhlevel =" & enhLevellist)
        Else
            Me.EnhPriceSellTxt = ""
            Me.EnhPriceBuyTxt = ""
    
            Me.EnhStoreSellTxt = ""
            Me.EnhStoreBuyTxt = ""
        End If

'Price to Buy At
        Me.EnhPriceBuyTxt = _
            DMin("enhpricebuy", "enhancements", "enhname = '" & Enhnamelist & "' AND " & "enhlevel =" & enhLevellist)
        If Me.EnhPriceBuyTxt <> "" Then
'Store to Buy At
            Me.EnhStoreBuyTxt = _
                DMax("enhStore", "enhancements", "enhname = '" & Enhnamelist & "' AND " & " enhpriceBuy =" & EnhPriceBuyTxt & " AND " & "enhlevel =" & enhLevellist)
        Else
            Me.EnhPriceSellTxt = ""
            Me.EnhPriceBuyTxt = ""
    
            Me.EnhStoreSellTxt = ""
            Me.EnhStoreBuyTxt = ""
        End If
    Else
        Me.EnhPriceSellTxt = ""
        Me.EnhPriceBuyTxt = ""
    
        Me.EnhStoreSellTxt = ""
        Me.EnhStoreBuyTxt = ""
    End If


also the form has 6 fields first too going across are comboboxes first is name and the other is level the 3rd is store name (one I want to change) and the 4th is price the 5th and 6 are a repeat of 3 and 4 but for buying instead of selling! :cool:

and the other strange part is no matter what I do the first combo box when it does the drop down useually you can type in a letter to goto that listing yet this one does it if I create a new one then save and does it for a while then stops? :confused:
 
Doh! I must have been tired last night lol :) I just put

Code:
mySQL = "Select enhStore from enhancements Where enhname = '" & Enhnamelist & "' AND " & " enhpriceBuy =" & EnhPriceBuyTxt & " AND " & "enhlevel =" & enhLevellist
EnhStoreBuyTxt.RowSource = mySQL

Where needed and well it works now! :)

Now I just have to figure out how to get it to use a specific default! :)
 

Attachments

Last edited:

Users who are viewing this thread

Back
Top Bottom