Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    2 Star Lounger
    Join Date
    Oct 2001
    Location
    Suffolk, England
    Posts
    134
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sub forms (2000)

    I have 2 seperate sub forms on a main form. I am on subform1 and want to refer to a control on the second subform. What is the syntax?
    Thanks

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Sub forms (2000)

    If i remember correctly it is:

    forms![main form]![sub form2 name].form!controlname

    In later versions of access it was not necessary to include the .form

  3. #3
    2 Star Lounger
    Join Date
    Oct 2001
    Location
    Suffolk, England
    Posts
    134
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sub forms (2000)

    sorry, but that comes back with the message that is is an invalid reference to the property form/report.

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Sub forms (2000)

    What did you use? Describe the expression you used.

  5. #5
    2 Star Lounger
    Join Date
    Oct 2001
    Location
    Suffolk, England
    Posts
    134
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sub forms (2000)

    This expression was:
    Forms![FrmCCMDS]![SubMaxOrgans].Form!TxtMaxOrgans = Me.Parent.TxtMax
    where FrmCCMDS is the parent form., SubMaxOrgans is the secodn subform and TxtMaxOrgans is the control (TxtMax is another control on the parent form)

  6. #6
    2 Star Lounger
    Join Date
    Oct 2001
    Location
    Suffolk, England
    Posts
    134
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sub forms (2000)

    This expression was:
    Forms![FrmCCMDS]![SubMaxOrgans].Form!TxtMaxOrgans = Me.Parent.TxtMax
    where FrmCCMDS is the parent form., SubMaxOrgans is the second subform and TxtMaxOrgans is the control (TxtMax is another control on the parent form)

  7. #7
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Sub forms (2000)

    Check out <post#=446806>post 446806</post#>.

    Also check if the form and subform names (their names in the main form, not the names in the database window) are correct.

  8. #8
    4 Star Lounger SteveH's Avatar
    Join Date
    Jan 2001
    Location
    Chelsea, Gtr London, United Kingdom
    Posts
    587
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sub forms (2000)

    I use this page from The Access Web as my source of reference for these types of problems.
    Steve H
    IT Lecturer/Access Developer
    O2K SR3/O2010; Win7Pro

  9. #9
    2 Star Lounger
    Join Date
    Oct 2001
    Location
    Suffolk, England
    Posts
    134
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sub forms (2000)

    Thanks for your help - I have even tried using the builder toput an expression in a control box - but still get an error message. I don't know what's wring with it!
    I'll have to thin of another way round it.
    Thanks for your help

  10. #10
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Sub forms (2000)

    Why don't you send a compacted zipped version of your database and we'll see what we can do.

  11. #11
    2 Star Lounger
    Join Date
    Oct 2001
    Location
    Suffolk, England
    Posts
    134
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sub forms (2000)

    I attach a cut down version of the database - Thanks. The main for m is FrmCCMDS and what i want to happen is that when the maximum of organs supported is altered - by ticking one of the boxes in the FrmOrgansSupported - it alters the value in TxtMax on the main form (which i will make invisIble)
    Thanks again
    Allison

  12. #12
    2 Star Lounger
    Join Date
    Oct 2001
    Location
    Suffolk, England
    Posts
    134
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sub forms (2000)

    And now I'll attach the file!

  13. #13
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Sub forms (2000)

    I cannot see where that command is? It does what you say it does, what is the problem?

  14. #14
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sub forms (2000)

    Hi Allison,
    here's the expression you need to put in the TxtMax Control Source box in the property sheet:
    =SubMaxOrgans.Form!TxtMaxOrgans

  15. #15
    2 Star Lounger
    Join Date
    Oct 2001
    Location
    Suffolk, England
    Posts
    134
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sub forms (2000)

    I'm sorry, I am not being very clear. Ultimately what I want to do is pass an up-to-date value for the maximum of organs supported (this is for an intensive care unit) in any admission period to the admission data table. So when the number of organs supported changes, the maximum number is recalculated and the figure in admission data is updated. i realise that this is a long way round of doing it - but at the time it seemed a simple way of doing it!
    Allison

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
  •