R
richardconers
I have access xp. I want to obtain a value from a field of an open
query (let's say a query called MyQuery) using vba. I tried using
docmd.gotorecord which takes me to the record I want. I would like to
obtain the value of a field (let's say a field called CID).
However the code anumber =
screen.activedatasheet.Recordset.Fields("CID").Value gives the error
that there is no activedatasheet (since I'm running the vba from a
form, the query window is not the active window). How do I obtain the
value of the field CID in the open query MyQuery?
Thank you!!!
query (let's say a query called MyQuery) using vba. I tried using
docmd.gotorecord which takes me to the record I want. I would like to
obtain the value of a field (let's say a field called CID).
However the code anumber =
screen.activedatasheet.Recordset.Fields("CID").Value gives the error
that there is no activedatasheet (since I'm running the vba from a
form, the query window is not the active window). How do I obtain the
value of the field CID in the open query MyQuery?
Thank you!!!