Unanswered: combo box of main form define combo box list of subform
I try to connect combo box of main form define combo box list of subform.
Le me explain.
I have four table.
Table 1: job list with field: jobId, jobname, job description, job date
Table 2: job name: simple list of possible job used by Table 1
Table 3: work list: it have workID, jobid (connected with jobid of Table 1), workedname, kindofwork, hours
Table 4: list of work what worker can do: kindofworkid, jobnameID, kindofwork
Table 1 and 3 are main one, connecte by jobid
Where I input in form I pur jobname (from list of Table 2), descrption and date
Then I think to have subform with list of worker do this job and they kindofwork. So info from Table 3
Possible kindofwork is define by jobname.
so for example let say we have Jobname1 and Jobname2
In table 4 is define that Job 1 have kindofwork1, 2, 3, 4
And Job2: have kindofwork 5, 6
So if I define jobname2 in mainform I look to have in subform onyl kindofwork5 and 6.
So two combo box in this question is Jobname (table2) and kindofwork (table4)
If it is in one form Jobname combobox will have afterupdate event wiht Rowsource.
In attach is little part of real tables info but enought for example.
One form with subform. I delete not necessary info.
What I am looking for it to find way after select Jobname-combo box of main form Job nuovo to give in subform Job Nuovo sub for combobox Ruolo-Kindofwork just possible kindofwork.
Or to be more clear if select Jobname1 to have just 17 possible ruolo-kindofwork list
Mainform and subform is design to receive all info what is inputed in one time.
I'm to sure to understand what you try to do. Your sentence:
To filter in Combobox Ruolo in "Lavoro nuovo sub" I put this criteria:
is not clear to me. What exactly do you want to filter? The subform recordset or the combobox contents?
If, as I suppose, it's the combo, you can't do it that way. Combo boxes don't have a Filter property. If you want to change the contents of a combo (the same is true for a ListBox), you have to modify its RowSource property.
In any case you have to specify the property you're addressing: nor the Filter property of a (sub)Form, nor the RowSource property of a List or Combo box is the default property of the object, so you must use the full syntax: <Object>.<Property>
Let me explain more.
I have table Ruolo where is define kind of works.
For ever Edizione (for this combobox to receive EdizioneID) is define few Ruolo.
In total are now 184 ruoloID for 12 different EdizioneID.
For this I am looking way to have in subform with writing Persona only Ruolo define for selected EdizioneID
Now for Ruolo combobox to receive list of Ruolo for define EdizioneID in Rowsource I have this:
SELECT Ruolo****oloID, Ruolo****oloEdizioneID, Ruolo****olo
WHERE (((Ruolo****oloEdizioneID)=[forms]![lavoro nuovo]![Lavoratori]![Form]![nuovaedizione]));