I have a text box on a form whose after update event is taking the value that was entered into the field and sending it to a query. If i perform this manually, meaning run the query in the after update it works just fine. But I want to learn how to do is set a Recordset equal to it. So what I have is this:
tblData = "qryTechTreeAll"
Set rst1 = dbs.OpenRecordset(tblData, dbOpenDynaset)
rst1.MoveFirst
I get an error that says "expected only 1 value" or something like that when it hits the Set rst1 line.
I also have this prior in my code and it works fine:
tblMaster = "tblTechMaster"
Set rst3 = dbs.OpenRecordset(tblMaster, dbOpenTable)
rst3.Index = "PrimaryKey"
rst3.MoveFirst
The query code which works when manually run is:
SELECT tblTechReqShort.TechResult AS Fld1
FROM tblTechReqShort
WHERE (((tblTechReqShort.TechResult)=[Forms]![frmTechTree]![CritTechID]))
ORDER BY tblTechReqShort
Am I using the OpenDynaset thing incorrectly or do you guys see something else here? I know you may wonder why the heck I am doing it this way at all... but without going into a ton of detail, let's just say I would MUCH prefer to use this recordset methodology than something else.
Any ideas? Thanks a ton as always!
Marco
tblData = "qryTechTreeAll"
Set rst1 = dbs.OpenRecordset(tblData, dbOpenDynaset)
rst1.MoveFirst
I get an error that says "expected only 1 value" or something like that when it hits the Set rst1 line.
I also have this prior in my code and it works fine:
tblMaster = "tblTechMaster"
Set rst3 = dbs.OpenRecordset(tblMaster, dbOpenTable)
rst3.Index = "PrimaryKey"
rst3.MoveFirst
The query code which works when manually run is:
SELECT tblTechReqShort.TechResult AS Fld1
FROM tblTechReqShort
WHERE (((tblTechReqShort.TechResult)=[Forms]![frmTechTree]![CritTechID]))
ORDER BY tblTechReqShort
Am I using the OpenDynaset thing incorrectly or do you guys see something else here? I know you may wonder why the heck I am doing it this way at all... but without going into a ton of detail, let's just say I would MUCH prefer to use this recordset methodology than something else.
Any ideas? Thanks a ton as always!
Marco