Can you use docmd.runsql with an INSERT INTO command like this...
first I open the database and a recordset.
then I do some stuff, but I would like to be able to use a line like
docmd.runsql "INSERT INTO [tblMsg] (User) VALUES('HELLO');"
although it won't find tblmsg. (i am trying to NOT link it with access' database splitter as the security is damn weak!)
___________________________________________________
Dim dbs As Database
Dim rst As Recordset
Dim TheLastFieldValue As String
Dim iStartCounter As Long
Dim iCounter As Long
Dim TheFieldName As String
Set dbs = DBEngine.Workspaces(0).OpenDatabase("N:\MsgBackend.mdb")
Set rst = dbs.OpenRecordset("tblMsg")
rst.MoveFirst
iStartCounter = rst.RecordCount - 5
If iStartCounter < 1 Then iStartCounter = 1
Rem Do some stuff
rst.MoveNext
Next iCounter
___________________________________________________
first I open the database and a recordset.
then I do some stuff, but I would like to be able to use a line like
docmd.runsql "INSERT INTO [tblMsg] (User) VALUES('HELLO');"
although it won't find tblmsg. (i am trying to NOT link it with access' database splitter as the security is damn weak!)
___________________________________________________
Dim dbs As Database
Dim rst As Recordset
Dim TheLastFieldValue As String
Dim iStartCounter As Long
Dim iCounter As Long
Dim TheFieldName As String
Set dbs = DBEngine.Workspaces(0).OpenDatabase("N:\MsgBackend.mdb")
Set rst = dbs.OpenRecordset("tblMsg")
rst.MoveFirst
iStartCounter = rst.RecordCount - 5
If iStartCounter < 1 Then iStartCounter = 1
Rem Do some stuff
rst.MoveNext
Next iCounter
___________________________________________________