Read/write directly to a table with code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to store a default folder path in table as a string and retrieve it
with code. Is there a facility to read and write directly to a table with
code?

The table I’m reading/writing to will have one record and a number of
different fields for storing data.

Thanks for any help.
Seth
 
Use DLookup to get stuff from a table and Docmd.RunSQL to put it back.
e.g.
Dim strTemp as String

strTemp = DLookUp("FolderPath","YourTable")

DoCmd.RunSQL "UPDATE [YourTable] SET FolderPath = '" & strTemp & "'"
 
Further to my last post, the UPDATE will give a message to say you are about
to update 1 record in the table. To do it without messages put these 2 lines
either side of the DoCmd.RunSQL line
DoCmd.SetWarnings False

DoCmd.SetWarnings True
 
Back
Top