Rick said:
None. RunSQL is for "action queries" (update, insert, delete). You need to
open a Recordset object...
Dim db as Database
Dim rs as Recordset
Set db = CurrentDB
Set rs = db.OpneRecordSet("select statement")
...then you have lots of things you can do with the recordset depending on the
kind it is and what your select statement is.
Do Until rs.EOF
MsgBox("The second field value is " & rs.Fields(1))
rs.Edit
rs.Fields(1) = "some New Value"
rs.Update
rs.MoveNext
Loop
It would be difficult to list ALL of the methods available in a Recordset.
Consult the help file for more details or post specific questions for what you
want to do.
Thanks Rick, what you say makes sense, but then I'm so new to this
aspect of Access you could be telling me the moon was made of cheese.
I've coded like you suggested. In fact the code I've written I'll post
here:
Dim Licenses As Database
Dim HostRecords As Recordset
Set Licenses = CurrentDb
Set HostRecords = Licenses.OpenRecordset("SELECT
HostSystems.hostname FROM HostSystems WHERE
(((HostSystems.hostname)=Forms!DeleteHostForm!hostname))")
<the select statement comes from a regular select query I built and
then copied the resultant SQL>
....and my error message has changed. It now reads "Too few parameters,
expected: 1". Can you interpret this? I've looked at the help page for
the OpenRecordset method and have tried a few things, only to get
further, more complicated errors messages referring to Jet. Do I need
to set up any preparatory statememnts for this SQL to run?