
docmd.runsql repeat problem
Again, without seeing the actual code you run it is difficult to guess.
You might try something like:
Private Sub WhatEverEventYouAreUsing()
Dim strSQL as String
strSQL = ""
strSQL = "Insert into Tablename (fieldlist) Values(valuelist)""
DoCmd.RunSQL(strSQL)
End Sub
Quote:
> Hi John thanks for the reply,
> Basically I have one line of code :
> Docmd.runsql (insert into """""""""" Lots of fields """""" vaues
> """""" Lots of values")
> and thats it for the running of the sql statement to append the data to
> the the table.
> So what you've sounds spot on .. question is how am I supposed to do it in
> steps. IE initializing the SQL then run it
> Thanks for your help
> Russ
> > Are you initializing the SQL statement after you run it? Or before you
> > build it?
> > If not, the SQL statement may be retaining parts of your first
> > execution. It is hard to diagnose this problem without seeing the
> > code.
> > > Hi all, I have an unbound form from which I use a runsql append
> query to
> > > input the data to the table. Then it clears the unbound form of
> information
> > > for the proccess to be repeated. My problem is that I keep getting
> > > violations when the runsql executes so it only inserts the first record
> then
> > > I have to close the form reopen it and I can insert the next record.
> > > Any one any ideas of what is happening. AS I am compeletely lost.
> > > Thanks in advance Russ