Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2003
    Location
    North Yorkshire, UK
    Posts
    9

    Unanswered: Passing Parameters to Parameter Queries

    Is there any way to automatically enter a parameter into a parameter query without having to enter it manually from the dialog box?

    I'm producing a league table system for a table tennis league, and I need a value on a form (the fixture ID) that shows an individual fixture to be entered into a parameter query to find players involved in that match. It would be infinitely preferable if there was some way to automate the entering of the parameter, so that the user does not have to do it manually. Is there any way to do this? I'm guessing VBA, but i'm not an expert in that field.

    Many thanks if anyone can help, Joe Seed

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    By this:

    I need a value on a form (the fixture ID) that shows an individual fixture to be entered into a parameter query to find players involved in that match.
    Do you mean that you have a form that the user is selecting "fixtures" from and you would like that value to be passed to the query?

    If so, in the recordsource of your query, use:

    SELECT somestuff
    FROM t1
    WHERE t1.individual_fixture = ?

    Then in query params, use:

    ? = forms!YourParameterForm!comboFixture.Value

  3. #3
    Join Date
    Dec 2003
    Location
    North Yorkshire, UK
    Posts
    9
    Thanks a lot, Teddy, though I couldn't quite get that to work - I must have done something wrong, but never mind now - I managed to get what I needed before to work by filtering a query using a subform, so in effect the ID on the form was the parameter, but now i've got a different problem. It's hard to explain without a screenshot, so i've attached an image of the form. It doesn't show all of it, but it's designed to work at 1024*768 and my college PCs only do 800*600.

    Basically, the player names in the two subforms at the top (Labelled "Select Home Players" and "Select Away Players") display the results of a query which looks up the teams which are scheduled to play, and the players registered for that team. It then displays the players who are availible for the match, as in the screenshot.

    The main form is set out in the format of a scorecard, which directly inputs data to a table. My problem is that the player names (both first name and surname fields) in the top two subforms somehow need to be migrated to the player name fields in the main form, and I can't find a way to do this - simply looking up the fields in the subforms isn's sufficient, as the order of the players may change, and also more than the 3 allowed players for any one match may be registered for the team.

    If anyone could give me an idea of how to get past this little problem, i'd be very grateful indeed - it's for my A-Level ICT Project, and the deadline's getting pretty close!

    (That's English A-Levels - I would say the US equivalent but I don't know what that is - i'm 18, in the final year of school)

    Thanks a lot, Joe Seed
    Attached Thumbnails Attached Thumbnails frmaddmatchscore.jpg  

  4. #4
    Join Date
    Dec 2003
    Location
    North Yorkshire, UK
    Posts
    9
    Bump

    Sorry about this, but i'm getting pretty desperate now, I just can't find a way round it and it's the last problem to complete before I can hand it in. Anyone?

Posting Permissions

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