Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Posts
    69

    Unanswered: Query Parameters from forms

    I've created a query in the Access query builder which has a Category feild. I want to take the criteria for this field from a unbound invisible text box on a open form. I have some radio buttons which poplute this text box with a string for my query criteria. i.e what ever category I want to be returned by the query. From within the query builder can I get access to this object using something like [Form].[NameofForm].[Nameoftxtbox].[Value] or Me.[Nameoftxtbox] etc. I've tried doing this but a popup appear up asking for me to enter the parameter [Form].[NameofForm].[Nameoftxtbox].[Value] or Me.[Nameoftxtbox]. Any help is much appriected.
    Attached Thumbnails Attached Thumbnails ss.gif  

  2. #2
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    The Me notation definitely won't work. The other form is the way to go. I think you just need a minor change:

    [Forms]![NameofForm]![Nameoftxtbox]

    The form must be open at the time you run the query, otherwise you will be prompted.

  3. #3
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    use the magic wand wizard builder thing in the menu bar.

    make a new query with no parameters, no criteria. add the table/fields you want

    click in the appropriate criteria box then click the wizard builder thing.
    left-pane of the dialog: forms/all forms/your hidden form
    middle-pane of the dialog: double-click the name of the textbox

    done!

    ...the wizard builder thing did not propose [Form] or [Me]
    most likely the proposal was something like:
    [Forms]![NameofForm].[Nameoftxtbox]

    izy
    currently using SS 2008R2

  4. #4
    Join Date
    Mar 2004
    Posts
    69
    Doh i was using Form instead of Forms no wonder it didn't work. Thanks

    Quote Originally Posted by izyrider
    use the magic wand wizard builder thing in the menu bar.

    make a new query with no parameters, no criteria. add the table/fields you want

    click in the appropriate criteria box then click the wizard builder thing.
    left-pane of the dialog: forms/all forms/your hidden form
    middle-pane of the dialog: double-click the name of the textbox

    done!

    ...the wizard builder thing did not propose [Form] or [Me]
    most likely the proposal was something like:
    [Forms]![NameofForm].[Nameoftxtbox]

    izy

Posting Permissions

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