I\'d like to be able to create a parameterized query in MS Access 2003 and feed the values of certain form elements to that query and then get the corresponding resultset ba
Here is a snippet of code. It updates a table using the parameter txtHospital:
Set db = CurrentDb
Set qdf = db.QueryDefs("AddHospital")
qdf.Parameters!txtHospital = Trim(Me.HospName)
qdf.ReturnsRecords = False
qdf.Execute dbFailOnError
intResult = qdf.RecordsAffected
Here is a sample of the SQL:
PARAMETERS txtHospital Text(255);
INSERT INTO tblHospitals (
[Hospital] )
VALUES (
[txtHospital] )