One combo box to load value automatically from another (1 Viewer)

sibbbra

Member
Local time
Today, 07:27
Joined
Feb 11, 2022
Messages
78
HI
i have a form in my db called All Customer Orders. On it , there is a combo box named Customer_ID. In this form, there is a sub form named frm line total sale3.
I want that if combo box named Customer_ID , one value is selected on this main form, then the combo box named Customer_ID in the subform frm line total sale3 should automatically select the same value . How to do so
plx help
I have uploaded my db.
thanx
 

sibbbra

Member
Local time
Today, 07:27
Joined
Feb 11, 2022
Messages
78
Thanx Bob. I have uploaded it.
 

Attachments

  • My db.accdb
    6.8 MB · Views: 101

bob fitz

AWF VIP
Local time
Today, 07:27
Joined
May 23, 2011
Messages
4,727
HI
I want that if combo box named Customer_ID , one value is selected on this main form, then the combo box named Customer_ID in the subform frm line total sale3 should automatically select the same value .
thanx

Possibly with an Update query, run in the After Update event of the combo box, but why would you want to do that?
And which record would you want to edit? The subform could have many records linked via the OrderID.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 07:27
Joined
Feb 19, 2013
Messages
16,616
I don't see any combo in the subform called customerID

either way, you should not be storing the data twice (since you already have the info via the orderID link) unless one order has many customers which seems very unlikely

And if you have to do it, you can do this without code by including more than one field in the subform linkchild/master properties

e.g. link master would be Order_ID;customer_id
 

sibbbra

Member
Local time
Today, 07:27
Joined
Feb 11, 2022
Messages
78
1672396871382.png

well, in the abpve pic, I want to have that when in upper filed of customer filed , some value is selected, then the lower combo box should automatically select the same value. but how
 

sibbbra

Member
Local time
Today, 07:27
Joined
Feb 11, 2022
Messages
78
T
I don't see any combo in the subform called customerID

either way, you should not be storing the data twice (since you already have the info via the orderID link) unless one order has many customers which seems very unlikely

And if you have to do it, you can do this without code by including more than one field in the subform linkchild/master properties

e.g. link master would be Order_ID;customThanx CJ, I solved it with your help. Great
 

sibbbra

Member
Local time
Today, 07:27
Joined
Feb 11, 2022
Messages
78
thanx CJ
I got it with your help . your are great >>>>>>
I don't see any combo in the subform called customerID

either way, you should not be storing the data twice (since you already have the info via the orderID link) unless one order has many customers which seems very unlikely

And if you have to do it, you can do this without code by including more than one field in the subform linkchild/master properties

e.g. link master would be Order_ID;customer_id
 

June7

AWF VIP
Local time
Yesterday, 22:27
Joined
Mar 9, 2014
Messages
5,474
But why? Why is customer in both datasets?
 

Users who are viewing this thread

Top Bottom