Using Access form fields in pass-through queries to MYSQL

  • Thread starter Thread starter Hammy
  • Start date Start date
H

Hammy

Guest
I don't know if this is thebest place for this, but here goes....

I have an Access FE using MYSQL 4.1 BE. I have several forms and PassThrough queries (using MYSQL syntax not supported or available in Access).

How can I use form field values to use as criteria for these queries?

FOr example, in a pure Access database. I may have a form 'Employees' with a text box 'EmployeeName'. THen have a query....

SELECT * FROM tblEMployees WHERE EmployeeName = [Forms]![Employees]![EmployeeName]

If I were to add this variable to my pass-through queries, it errors. How can I do the same thing, passing my form fileds to an Access Query? I am trying to do this right in the SQL view of the queries, not in VBA or Macros or anything.

Thanks,
Scott
 
Not sure if it is the most efficient method, but you could just do a lookup of the value in question, assign it to a variable, and then create the SQL statement to send off to MySQL, using the variable value, not the reference to the form.

MySQL really does not know anything about Access forms/fields.
 
Right, I could do that for many things. I more had in mind for reports. I usually have a bunch of pre-built queries in the query pane (which pretty much amount to stored procedures), then a form which allows users to select criteria before opening the form. Then, the query runs using the form field values to supply the report.

So I am thinking ahead and trying to decide how to still do this.
 

Users who are viewing this thread

Back
Top Bottom