Can i Filter a query in back-end from a front-end textbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neelsfer
    Contributor
    • Oct 2010
    • 547

    #1

    Can i Filter a query in back-end from a front-end textbox

    I can reference a query in a back-end database with this code in the row source of my list box on the front-end, but can i filter this back-end query from a textbox situated on the front-end form?
    Code:
    SELECT qrylistpatients1.*
    FROM qrylistpatients1 IN 'C:\pisprg\PISData.accdb';
    front-end database = pisprg.accdb
    the front-end form = Home
    front-end textbox = sub-district

    the query in backend -
    Code:
    SELECT qryListPatients.Surname, qryListPatients.Initials, qryListPatients.FirstName, qryListPatients.Gender, qryListPatients.IDNo, tblFacility.FacilityName, qryListPatients.FileNo, qryListPatients.ClientID, tblFacility.[Sub-District]
    FROM qryListPatients LEFT JOIN tblFacility ON qryListPatients.Facilityname = tblFacility.FacilityID
    ORDER BY qryListPatients.Surname, qryListPatients.Initials;
    Any suggestions please?
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    it is my understanding that if you have a stored query in an access backend datafile, the SQL is first transfered to the local-front-end for parsing and then execution. Rememeber, each installation of Access is acting as its own independant sever at the local level.

    Therefor, if the query references a form, it will be looking for that form once loaded and parsed or it will give you the usual generic parameter prompts.

    As to if you can then use this as the rowsource, IDK. Please attempt it and let us know what happens (^_^).

    Comment

    Working...