Folks,
Having problems with the Dlookup function. I have viewed FAQ 705-4978, but can't make it work.
I have a form where there are two combo boxes which select two "Reasons for Failure", combo1 being a Primary Cause and the combo2 being a Secondary Cause. I want to select the Primary Cause in the first combo and then in the second combo only to select those Secondary Causes that are related to the Primary. I then want to hold this data in a data table for later analysis. I have two tables PrimaryFailureReasons and SecondaryFailureReasons. The Primary holds just the Primary Cause, while the Secondary holds both Primary and Secondary. So, for instance, in the PrimaryFailureReasons table there is "Customer Caused" whilst in the SecondaryFailureReasons table there is "Customer Caused" (Primary field) and then Secondary Cause field reasons like "Not In", "No longer Required", "Cancelled Earlier" etc etc.
I am using the Dlookup function =DLookUp("[Secondary]","[SecondaryFailureReasons]","[Primary]=forms!Frm_Data![PrimaryReason]") in the Row Source line of combo2, but all I get is a blank. I can make it work using a query, but since this is going to used by several users, I felt that Dlookup is more dynamic and does not lock the data.
Having problems with the Dlookup function. I have viewed FAQ 705-4978, but can't make it work.
I have a form where there are two combo boxes which select two "Reasons for Failure", combo1 being a Primary Cause and the combo2 being a Secondary Cause. I want to select the Primary Cause in the first combo and then in the second combo only to select those Secondary Causes that are related to the Primary. I then want to hold this data in a data table for later analysis. I have two tables PrimaryFailureReasons and SecondaryFailureReasons. The Primary holds just the Primary Cause, while the Secondary holds both Primary and Secondary. So, for instance, in the PrimaryFailureReasons table there is "Customer Caused" whilst in the SecondaryFailureReasons table there is "Customer Caused" (Primary field) and then Secondary Cause field reasons like "Not In", "No longer Required", "Cancelled Earlier" etc etc.
I am using the Dlookup function =DLookUp("[Secondary]","[SecondaryFailureReasons]","[Primary]=forms!Frm_Data![PrimaryReason]") in the Row Source line of combo2, but all I get is a blank. I can make it work using a query, but since this is going to used by several users, I felt that Dlookup is more dynamic and does not lock the data.