Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Warrington, Cheshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Parameterised queries (Access2003)

    I am attempting to build a lottery database for a charity.

    I have a membership table and a draw details table.
    In the DrawDetail table, there can be :
    - entries for different lottery numbers (member wants more than one lottery number entered for each draw) and
    - multiple entries for each lottery number (organisers want to keep history records, so each row records when the member paid and what draw numbers they were entered in/are the year/draw values for the current lottery year.

    Because the organisers want to hold the draw as year number and draw number (e.g. 1,14, 2,5) rather than actual date, working out which entries a payment entitles a member to is error prone; we therefore want to calculate it for them.

    I have successfully written an append query which, when given a unique row identifier and lottery number appends one row to the draw detail table, calculating the year and draw values as it goes.

    The lottery administration form displays member details with draw details as a subform. When the organiser records a new payment from a member, there is a need to
    Silverback

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

    Re: Parameterised queries (Access2003)

    The 'syntax' to refer to a control on a subform is

    [Forms]![MainForm]![SubForm]![Control]

    In this expression, SubForm must be 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. You can see the control name by opening the main form in design view and clicking once on the subform to select it. The control name will be displayed in the title bar of the Properties window, and of course, in the Name property.

    And yes, if the focus is on any field in a subform, the entire row containing the field will be the current record, so the above expression will refer to the value from that record.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Warrington, Cheshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Parameterised queries (Access2003)

    Thanks for the way to refer to the control and for the tip about the subform name. It was actually different to that in the Forms window.
    Silverback
    Silverback

Posting Permissions

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