Hello all,
I have a question on Query execution in MS Access object using vba.
#MS Access 2016
I use the below statement to execute a query,
DoCmd.OpenQuery queryname,acNormal,acEdit
The above is working fine, for without parameter scenario.
I am trying to add some parameter value for this query, please see below
----------------------------------------------------------------------------------------------------------------------------
PARAMETER txtValue LongText
SELECT DISTINCTROW Patient.PATIENTNUMBER, Patient.TITLE, Patient.LASTNAME, Patient.FIRSTNAME,
Patient.ADDRESS, Patient.CITYPROVINCE, Patient.POSTALCODE, Patient.RPTITLE, Patient.RPLASTNAME, Patient.RPFIRSTNAME,
Patient.RPADDRESS, Patient.RPCITYPROVINCE, Patient.RPPOSTALCODE, Patient.RPPHONEHOME, Patient.RPPHONEBUS,
Dentist.DLASTNAME, Dentist.DFIRSTNAME, Dentist.DADDRESS, Dentist.DCITYPROVINCE, Dentist.DPOSTALCODE,
txtValue AS Reported INTO tblMergeDataD
FROM Dentist INNER JOIN Patient ON Dentist.DENTISTNUMBER = Patient.DENTISTNUMBER
WHERE (((Patient.PATIENTNUMBER)=[Forms]![frmMainReportPatient]![ctlPatientNumber]));
-----------------------------------------------------------------------------------------------------------------------------
How to pass the parameter value to this query?
Thanks in advance.