Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Subform Reference Problem (2002)

    Hi,

    I'm working with a database that someone else built so its very foreign to me. It looks like a lot of it was done with wizards and there is very little relabeling of commands. I'm trying to make some revisions for the user and at the present time am trying ot filter reports by the email address. The database is too big to upload and every time I try to strip it down links are lost etc. The Main form [RFQ's - Main Form] contains a subform [RFQ's - Vendor Quotes Subform - Cage Codes ONLY] which the properties list names as [RFQ's - Vendor Quotes Subform1]. No matter what I use as the reference in the code, nothing works. I've tried =[Forms]![RFQ's - Vendor Quotes Subform1]![email] and =[Forms]![RFQ's - Vendor Quotes Subform - Cage Codes ONLY]]![email] but neither work. The command on the main form needs to = [email] on the subform.

    Thanks,
    Leesha

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Subform Reference Problem (2002)

    This is too vague to answer. See <post#=401925>post 401925</post#> for instructions on how to reduce the size of a database for posting, or explain in more detail what you've tried that doesn't work.

  3. #3
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Subform Reference Problem (2002)

    I've tried but due to all the links etc. you'll get tons of errors trying to get it to run the form. Should I still proceed and send with the errors?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Subform Reference Problem (2002)

    You can try - without seeing the database it'll be very difficult to say anything.

  5. #5
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Subform Reference Problem (2002)

    OK, here goes. Text187 needs to = email. I had to put it in 97 version to get it small enough.
    Attached Files Attached Files

  6. #6
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Subform Reference Problem (2002)

    Hi Leesha

    I have had a look at it now and I see the problem.

    As the Email address is in the sub form you cannot reference in the Forms![frmMaster]![sfrmChild] way. You have to reference directly to the subform

    =[sfrmChild]![EMAIL]

    Just replace sfrmChild with the name of you sub foem that contains [EMAIL]
    Jerry

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Subform Reference Problem (2002)

    There is no Text187 on the main form or on the subform, so I have no idea what you mean.

  8. #8
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Subform Reference Problem (2002)

    Sorry, its 176. I have the two items in yellow so they stand out.

    Leesha

  9. #9
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Subform Reference Problem (2002)

    Hi Jerry,

    I tried this the way you had it typed =[sfrmChild]![EMAIL] but it still comes up as #name. I've done this same type of thing with other forms and subforms and don't know why I'm having so much trouble with this one.

    Leesha

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Subform Reference Problem (2002)

    You shouldn't have [Forms] in the control source. Use =[RFQ's - Vendor Quotes Subform1]![email]

  11. #11
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Subform Reference Problem (2002)

    Jerry, that won't work. You must use the name of the subform as a control on the main form. This is not necessarily the same as the name of the subform in the database window, and in this case it is different. You can see the name of the subform as a control by opening the main form in design view and clicking once on the subform. The control name will be shown in the toolbar and in the Properties window.

  12. #12
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Subform Reference Problem (2002)

    That worked! Thanks! Now, I'm also trying to use the same info to filter a report to the email address contained in the subform or to the control now on the main form. I've used =forms!............................... like I did in the control on the main form (before you had me fix it) and I get an error that says it can't find the form. What am I doing wrong with that?

    Thanks,
    Leesha

  13. #13
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Subform Reference Problem (2002)

    <P ID="edit" class=small>(Edited by Jezza on 18-Feb-07 22:53. Changed name of subform as it is very difficult to obtain reference in read only format)</P>Sorry I was using sfrmChild as a demonstration

    in yours try:

    =[RFQ's - Vendor Quotes Subform1]![EMAIL]
    Jerry

  14. #14
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Subform Reference Problem (2002)

    Beat you to it, see my edit comment.

    I still had the answer in my previous post but I hadn't realised I had to explain it further
    Jerry

  15. #15
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Subform Reference Problem (2002)

    A subform is not part of the Forms collection, only main forms are. If you want to refer to a text box on a subform from outside the main form, you must use the syntax

    =[Forms]![NameOfMainForm]![NameOfSubForm]![NameOfControl]

    In this situation:

    =[Forms]![RFQ's - Main Form]![RFQ's - Vendor Quotes Subform1]![email]

Page 1 of 2 12 LastLast

Posting Permissions

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