Hi All.
I created multi-level cascade combo boxes with option to add new item(s). But I would like also create a code to pass value from parent form to child form and then when new items are saved into database table from child form return to parent form and refresh data in it. What I mean. For instance, I have parent form with multi-level cascade combo boxes. When user select value from first combo box and didn't find needed value in second combo box then user will click button to call child form to add new item to second combo box.
Question1: How to pass selected value from first combo box from parent form to child form and to make that value read only?
Then when user entered all required data and saved their in child form user will close child form to return to parent form.
Question 2: How to refresh list and display a new added value in second combo box when user will return to the parent form?
The same story with third combo box.
Question 3: I cannot figure out why that code:
Code:
DCount("*", "tblDeviceTypes", "DeviceType =" & !DeviceType & " AND BrandID = " & !BrandID) > 0 Then
MsgBox "Brand and Device Type already exist. Please enter a different Device Type.", vbOKOnly
SetSaveClose Me, False
Cancel = True
Exit Sub
return an error message:
When that piece of code commented i have ability to save a record. I will be appreciate if someone show how to solve those problems.
In the attachment is last version of DB file.
Thanks.
AddNewCascadeCB.zip