So I have a form that fills out a table and I have 4 combo boxes that are based off of each other where as I select a machine it only shows pm's for that machine in the next combo box. Now I want a text box to display the frequency of the pm based on what pm is selected. I tried this in control source for the text box:
=DLookUp("[Frequency]","tblTask","[tblTask].[Maint Work] = " & [Maintwork])
Maintwork is the name of the combo box on the form
when I use this the text box just flashes really fast with #error!
I think I read something that Dlookup has to return a unique value and maybe that is my problem? There could be multiple machines with the same PM just different names and the frequency repeats a lot like "weekly"
I also tried the same setup for my combo boxes which is like: =SELECT DISTINCT tblTask.[Frequency], tblTask.[Maint Work] FROM tblTask WHERE (((tblTask.[Maint Work])=Forms![frmPMfill]![Maintwork]));
But it seems I can't use select distinct for text box control source?
=DLookUp("[Frequency]","tblTask","[tblTask].[Maint Work] = " & [Maintwork])
Maintwork is the name of the combo box on the form
when I use this the text box just flashes really fast with #error!
I think I read something that Dlookup has to return a unique value and maybe that is my problem? There could be multiple machines with the same PM just different names and the frequency repeats a lot like "weekly"
I also tried the same setup for my combo boxes which is like: =SELECT DISTINCT tblTask.[Frequency], tblTask.[Maint Work] FROM tblTask WHERE (((tblTask.[Maint Work])=Forms![frmPMfill]![Maintwork]));
But it seems I can't use select distinct for text box control source?