Solved Form with a combo box show all details in the fields base on selected customer (1 Viewer)

Number11

Member
Local time
Today, 10:00
Joined
Jan 29, 2020
Messages
607
So I need to create a form that will have a combo box which you select the customer account_No and then want it to populate the records in text boxes below for that selected customer

TextBox1 = Address
TextBox2 = Telephone
TextBox3 = Last Order Date

ect
 

Minty

AWF VIP
Local time
Today, 10:00
Joined
Jul 26, 2013
Messages
10,353
Create a query that brings in those details, make that the rowsource of the combo.
Then set the column count accordingly , finally set the column widths to hide what you don't want to see.

Then in your TextBox1 set it's control source to
= MyCombo.Column(1)

Colum numbering in combo's starts at 0
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 18:00
Joined
May 7, 2009
Messages
19,169
combo properties:

RowSource:
select account_no, address, telephone, dmax("[last order date]", "[order tablee]", "account_no = '" & account_no & "'") as dte from yourTable

Bound Column: 1
Column Count: 4
Column Widths: 1;1;1;1
List Width: 3


combobox AfterUpdate event:

private sub combo_afterupdate()
me!Textbox1 = me!combo.Column(1) 'address
me!Textbox2 = me!combo.Column(2) 'telephone
me!Textbox3 = me!combo.column(3) 'last order date
end sub
 

Number11

Member
Local time
Today, 10:00
Joined
Jan 29, 2020
Messages
607
combo properties:

RowSource:
select account_no, address, telephone, dmax("[last order date]", "[order tablee]", "account_no = '" & account_no & "'") as dte from yourTable

Bound Column: 1
Column Count: 4
Column Widths: 1;1;1;1
List Width: 3


combobox AfterUpdate event:

private sub combo_afterupdate()
me!Textbox1 = me!combo.Column(1) 'address
me!Textbox2 = me!combo.Column(2) 'telephone
me!Textbox3 = me!combo.column(3) 'last order date
end sub
Thanks sorry forgot to say I first have a form in which post code is entered this opens up another form and now on that for i need to show by selecting the customer in the combo
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 18:00
Joined
May 7, 2009
Messages
19,169
just add criteria to your combobox rowsource:

RowSource:
select account_no, address, telephone, dmax("[last order date]", "[order tablee]", "account_no = '" & account_no & "'") as dte from yourTable
where [postcode] = '" & [forms]![firstFormName]![postcode] & "'"
 

Users who are viewing this thread

Top Bottom