Cascading combobox and bound textboxes (1 Viewer)

Lol999

Registered User.
Local time
Yesterday, 22:15
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
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:15
Joined
May 7, 2009
Messages
19,230
What is the rowsource if 2nd combo. The controlsource of the texboxes?
 

Lol999

Registered User.
Local time
Yesterday, 22:15
Joined
May 28, 2017
Messages
184
Hi arnelgp, the rowsource is set to a query based upon the value selected in combo 1.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:15
Joined
May 7, 2009
Messages
19,230
The select statement. And the control source of the 3 textboxes.
 

Lol999

Registered User.
Local time
Yesterday, 22:15
Joined
May 28, 2017
Messages
184
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.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:15
Joined
May 7, 2009
Messages
19,230
Can u zip and uoload your db i cant make a pic of what you want to do.
 

Lol999

Registered User.
Local time
Yesterday, 22:15
Joined
May 28, 2017
Messages
184
Okay here it is. The form is frmInspection.
 

Attachments

  • Database.zip
    261.7 KB · Views: 48

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:15
Joined
May 7, 2009
Messages
19,230
You have to relink it first.
 

Attachments

  • Desktop.zip
    259.4 KB · Views: 61

Lol999

Registered User.
Local time
Yesterday, 22:15
Joined
May 28, 2017
Messages
184
I was editing and using from a linked pair off the company network so I'm a bit confused on that one.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:15
Joined
May 7, 2009
Messages
19,230
Just open the fe and copy the code if the 2nd combo afterUpdate.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:15
Joined
May 7, 2009
Messages
19,230
Your welcone.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 01:15
Joined
Feb 19, 2002
Messages
43,257
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

Top Bottom