Results 1 to 6 of 6
  1. #1
    Join Date
    May 2008
    Posts
    24

    Unanswered: combo box of main form define combo box list of subform

    Hello,
    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.

    How to do this with subform?

  2. #2
    Join Date
    May 2008
    Posts
    24
    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.
    Attached Files Attached Files

  3. #3
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Your database is not functional: the form [Job Nuovo] asks for a parameter value JobID that seems to be missing. When opened a reference is missing too (#Name?)
    Attached Thumbnails Attached Thumbnails ScreenShot001.jpg   ScreenShot002.jpg  
    Have a nice day!

  4. #4
    Join Date
    May 2008
    Posts
    24
    Definitive I delete to much field for this example.
    I believe all my problem is bad reference.
    Look this name:

    Mainform name: Lavoro nuovo
    subform name: Lavoratori
    In subform is show form name: Lavoro nuovo sub

    In "Lavoro nuovo" is combobox name: nuovaedizione

    To filter in Combobox Ruolo in "Lavoro nuovo sub" I put this criteria:
    Forms![Lavoro Nuovo]![Lavoratori].Form![nuovaedizione]

    But I not receive list looking for and receive "Enter Parameter Value"
    Somekind of reference is wrong

  5. #5
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    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>
    Code:
    Forms![Lavoro Nuovo]![Lavoratori].Form![nuovaedizione].RowSource = ...
    or
    Code:
    Forms![Lavoro Nuovo]![Lavoratori].Form.Filter = ...
    Have a nice day!

  6. #6
    Join Date
    May 2008
    Posts
    24
    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
    FROM Ruolo
    WHERE (((Ruolo****oloEdizioneID)=[forms]![lavoro nuovo]![Lavoratori]![Form]![nuovaedizione]));

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •