Results 1 to 10 of 10
  1. #1
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155

    Form works, Subform gets error

    I have a subform within a Search form. Everything works except when I try to work through the cascading combo boxes. In the orginal form, it works.



    Orginal: FmInitial
    Search: FmSearch
    Subform in FmSearch: SubFmInitial

    I get "Enter Parameter Value : Forms!FmInitial!cboActRoot" when I try to go to the second box. I tried changing the SubFmInitial to FmInitial thinking that might have been the error but it didn't work. And if it makes a difference, this field does not have to work in the FmInitial but needs to work in the Sub Form.

    Any ideas as to why before I screw the whole thing up trying to figure it out?

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    See if this links helps at all: http://www.mvps.org/access/forms/frm0031.htm

  3. #3
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    No, that didn't help I was using something like that to create the search functions though...any other ideas?

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    SubForms are *not* listed in the FORMS collection, only MainForms.

  5. #5
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    So i changed it to Forms!FmSearch!cboActRoot and the error goes away but then there isnt a list anymore. just a blank combo box...The following is the row source for each of the combo boxes for the cascading effect.

    cboActRoot: SELECT DISTINCT tblRootCause.Category FROM tblRootCause ORDER BY tblRootCause.Category;

    cboActSubCat1: SELECT DISTINCT tblRootCause.IssueDetail, tblRootCause.Category FROM tblRootCause WHERE (((tblRootCause.Category)=Forms!FmSearch!cboActRoot)) ORDER BY tblRootCause.IssueDetail;

    cboActSubCat2: SELECT DISTINCT tblRootCause.DetailType FROM tblRootCause WHERE (((tblRootCause.IssueDetail)=forms!FmSearch!cboAct SubCat1));

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    In order to reference a control on a SubForm, you need to go through the MainForm reference in the FORMS collection.
    Forms!MainFormName!SubFormControlName.FORM!Control NameOnSubForm
    Remember that SubFormControls do not have to be named the same as the SubForm they display.

  7. #7
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    So, the subform itself is a control?

    IE =Forms!FmSearch!SubFmInitial.Form!cboActRoot

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Forms are displayed on other forms by the use of a SubFormControl.

  9. #9
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    Gotcha, thanks for the info. It finally worked. I had tried doing something similiar to this once before but it didn't work. But apparently I was on the right track. Thanks again!

    Ill mark this as solved.

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Great. It is a common problem and takes some getting used to before the concept sinks in.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Form and Subform error trapping
    By usmcgrunt in forum Forms
    Replies: 8
    Last Post: 09-12-2010, 11:54 AM
  2. Replies: 3
    Last Post: 09-09-2010, 08:02 AM
  3. Replies: 4
    Last Post: 05-17-2010, 05:32 PM
  4. Replies: 1
    Last Post: 10-20-2009, 02:05 PM
  5. Replies: 1
    Last Post: 08-03-2009, 08:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums