Cascading combobox and bound textboxes

Lol999

Registered User.
Local time
Today, 08:29
Joined
May 28, 2017
Messages
184
Hi folks, hope someone can help me with this one because it's got me puzzled (no change there then).

I have a form with a subform. The main form has two cascading comboboxes on it which work fine.
I have created 3 textboxes bound to a table and the corresponding fields.
What I would like to happen is when I make my selection from the second combobox, the textboxes update automatically.
In the AfterUpdate event for the second combobox I requeried the subform which works great, I have tried requerying the main form and individual controls to no luck.
The Recordsource for the mainform is set to the table from which the fields bound to the three textboxes are.
I would like also to be able to amend the details in the three text boxes and save the record accordingly.

Can anyone help please?
BTW - this is the LAST database I am ever creating so please help me go out with a bang!

Regards, Lol
 
What is the rowsource if 2nd combo. The controlsource of the texboxes?
 
Hi arnelgp, the rowsource is set to a query based upon the value selected in combo 1.
 
The select statement. And the control source of the 3 textboxes.
 
This is the sql for the cbbox2 :
SELECT tbl_Product.ID_Product, tbl_Product.Part_No, tbl_Product.Details, tbl_Product.Date_deCommissioned
FROM tbl_Product
WHERE (((IsNull([Tbl_Product].[Date_deCommissioned]))<>False) AND ((tbl_Product.[ID_Tool_Category])=4));

The control sources of the 3 textboxes are Date_Commissioned, Reason, Date_deCommissioned.
 
Can u zip and uoload your db i cant make a pic of what you want to do.
 
You have to relink it first.
 

Attachments

I was editing and using from a linked pair off the company network so I'm a bit confused on that one.
 
Just open the fe and copy the code if the 2nd combo afterUpdate.
 
Your welcone.
 
Just FYI,
Do not use VBA functions when there is an SQL method. It just adds unnecessary overhead to your query.

(((IsNull([Tbl_Product].[Date_deCommissioned]))<>False)

Should be

[Tbl_Product].[Date_deCommissioned] Is Not Null
 

Users who are viewing this thread

Back
Top Bottom