Question

so i have a ComboBox(ComboBox1) and from this ComboBox I would put a SO#(SalesOrder#) and click on an update button, when i click on this, the following fields would fill up according to the SO#(SalesOrder#) : TextBox1, ComboBox2, TextBox2, TextBox8, ComboBox5, TextBox4, TextBox5, ComboBox3, ComboBox4, ComboBox6, and TextBox7.

The Data needed are on the worksheet: Orders Database The Data for SO#(SalesOrder#) is on column A and are arranged according to the input above.

I don't have a sample code yet since i still have no idea on how to do this

so basically, i want to fill up the Other Fields according to the SO# field(ComboBox1) and use it as a searchbox for my database.

Was it helpful?

Solution

Asign a value to a text box

Dim OrderNumber as Range 

    Set OrderNumber = ActiveSheet.[A1]

    Me.MyTextbox = OrderNumber 'define a range inside VBA code
    ' or
    Me.MyTextbox = ActiveSheet.[A1] ' use absolute cell addressing
    ' or
    Me.MyTextbox = Range("MyWSRange").Cells(1,1) 'use a range defined in worksheet

With a ComboBox basically you can do the same. If you want to include the displayed value into the ComboBox DownDown list as well, you need to add it as an item

    Me.ComboBox1.AddItem ActiveSheet.[A1]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top