Results 1 to 6 of 6
  1. #1
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    BECCLES, Suffolk, England
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am running W7, MSO2003 SP3
    I have a data form for a client that displays, in a sub-form list, if that client has an employment and or a self-employment. The sub-form has a macro button that when clicked opens the main employment or self-employment form. The macro works perfectly when operated directly from the employment or self-employment listings and take me directly to the underlying data form.
    However when it is operated in the sub-form displayed in the clients data form I have to supply the ID of the record to be able to get to the underlying data form. Is there a way to get to the underlying form without having to type in the ID please?

    [SEID]=[Forms]![FrmSelfEmploymentListingShort]![SEID] is what is in the Where box in the macro. The first SEID refers to the selfemploymentdata form, which is where I want to get to.
    <IMG SRC=http://www.wopr.com/w3tuserpics/StephenElms_sig.jpg> Didn't think that I made my first post here on 5th February 2001...!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Your description leaves me totally confused. Could you try to explain that more precisely and clearly? Thanks.

  3. #3
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    BECCLES, Suffolk, England
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='794872' date='25-Sep-2009 14:45']Your description leaves me totally confused. Could you try to explain that more precisely and clearly? Thanks.[/quote]
    Sorry for that Hans.
    Client form displays 2 sub-forms: employment and self-employment. Each has a macro button on them. When the forms are viewed outside of the client form, the macro opens the full record of employment. However when the sub-forms are displyed, the macr makes you enter the ID number to get to the underlying form. Please have a look at the picture.
    Attached Images Attached Images
    <IMG SRC=http://www.wopr.com/w3tuserpics/StephenElms_sig.jpg> Didn't think that I made my first post here on 5th February 2001...!

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Try setting the Where Condition to

    [SEID]=[Forms]![NameOfMainForm]![FrmSelfEmploymentListingShort]![SEID]

    where NameOfMainForm is the name of the main form.

    Also, FrmSelfEmploymentListingShort must now be the name of the relevant subform as a control on the main form. This is not necessarily the same as the name of the source object. To see the control name, open the main form in design view, click once on the subform and look at the toolbar or at the Properties window to see the control name.

  5. #5
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    BECCLES, Suffolk, England
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Hans,
    Thanks for the information. Part of it worked (that referring to Returns) and the self-employment and employment didn't.
    The screen snip shows what happens when the button on the sub form is clicked. The button runs the macro in the second snip - which reads
    [SEID]=[Forms]![FrmIndividualDataQuery]![FrmSelfEmploymentListingShort]![SEID]
    Both of the form names are correct.
    The first one I treid worked perfectly:
    [TRRecord]=[Forms]![FrmIndividualDataQuery]![FrmTaxReturnsList]![TRRecord]
    I'd appreciate any help please.

    [attachment=85716:SelfEmployment.JPG]

    [attachment=85717:selfEmpl...entMacro.JPG]
    Attached Images Attached Images
    <IMG SRC=http://www.wopr.com/w3tuserpics/StephenElms_sig.jpg> Didn't think that I made my first post here on 5th February 2001...!

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Are you absolutely sure that FrmSelfEmploymentListingShort is the name of the subform as a control on FrmIndividualDataQuery?
    And is the name of the control bound to SEID on the subform also SEID?

Posting Permissions

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