Results 1 to 6 of 6
  1. #1
    fluppe is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Posts
    48

    query with parameter from Form


    Hi,

    i'm a total beginner with access and i wonder how to get a Parameter from a form into a query ...
    more precise:
    I have a form with a subform and a table. However I want to enter a number in the Form and then the subform shall display all entries from the table with that number as a specific field. So to speak i want to apply a filter.

    Can i do that somehow without using VBA ? And without entering the number in that tiny dialog window that pops up when i use "[ ... ]" brackets in my query ?
    This is may query so far .... and it is the datasrc for my subform ...
    Code:
    SELECT tbl_autos.ID, tbl_autos.Typ, tbl_autos.Alter, tbl_autos.BesitzerID
    FROM tbl_autos
    WHERE tbl_autos.GaragenID = <Param>;
    i want to replace <Param> with the content of my form.


    Thanks and greets so far from
    fluppe

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Why do you have a form/subform arrangement? Is the main form bound? Is the subform bound to a related table?

    Here is one method to use dynamic parameter: http://www.datapigtechnologies.com/f...tomfilter.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    fluppe is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Posts
    48
    Quote Originally Posted by June7 View Post
    Why do you have a form/subform arrangement? Is the main form bound? Is the subform bound to a related table?

    Here is one method to use dynamic parameter: http://www.datapigtechnologies.com/f...tomfilter.html
    Both, the form and the subform are bound to a table or a query respectively.
    In the future I want to be able to add new entries to the table from which my query gets the data by using the subform .... (which actually works, but as long as i don't know why, i won't trust that.)

    And I use a subform because I have ran into trouble when putting a Filter-Parameter into a Form that is bound to some data. It wants to change the data ... which is not intended.
    Maybe it would be better to have my Form not bound to some data. That would mean it contain an edit and the Subform.

    However, I will first look at that link i think ... which doesn't work because I need a plugin for that ... is it not possible to describe in few words how to get a Param for a query from a userdefined Form ?

    :::: another edit :::::
    What means "bound" to a table ? is it having the table set as "datasource" ( ... I think it is called "RecordSource" in VBA, if you use VBA to set this property of a form, but one can configure that by using the (show Properties -> Data tab).

    Thanks so far,
    fluppe

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    I guess to view the link requires Macromedia Flash Player Free Download.

    Bing: Access database dynamic parameter query

    See if this helps http://office.microsoft.com/en-us/ac...001117077.aspx

    The DataPig tutorial shows using LIKE operator with wildcard so records will retrieve if the control is blank. Controls used to input filter criteria must be UNBOUND.

    LIKE [Forms!formname!controlname] & "*"


    Yes, bound form means it has a RecordSource, bound control (textbox, combobox, listbox, checkbox) means the ControlSource is a field of the form's RecordSource.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    fluppe is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Posts
    48

    thanks

    Hi again and thanks for answer ...
    i took a brief look at that topic and i came to the insight, that what i intend to do will not work without a little VBA. These "Enter Parameter" prompts are what i wanted to avoid in the first place. But i still hoped there was a way to accomplish that without making use of VBA.
    However, i'll try with VBA now ....

    Greets,
    fluppe (MEZ 10:04)

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    To not use code (macro or VBA) would mean using the intrinsic Access filter/search tools from the ribbon, right click shortcut menu, and the navigation bar at bottom of form.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 02-28-2013, 01:20 PM
  2. Parameter query with DropBox through Form
    By dbalilti in forum Forms
    Replies: 17
    Last Post: 06-01-2012, 09:34 AM
  3. Opening form with parameter query
    By Lowell in forum Forms
    Replies: 5
    Last Post: 04-01-2012, 04:46 PM
  4. Re-Usable form/query parameter
    By nostr4d4m in forum Queries
    Replies: 1
    Last Post: 03-16-2011, 10:20 AM
  5. Form with parameter query subform
    By shiphtfour in forum Forms
    Replies: 11
    Last Post: 12-29-2010, 06:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums