Re: 2 sql command

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



You will have to write the SQL statements. Use query design to mock them up, and then switch to SQL View to see an exmaple of the string you need to create.

Then code like this:
Dim db As DAO.Database
Dim strSql As String

strSql = "INSERT ...
db.Execute strSql, dbFailOnError

strSql = "INSERT ...
db.Execute strSql, dbFailOnError

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"enrico via AccessMonster.com" <u41845@uwe> wrote in message
news:913b3be91de17@xxxxxx
its an INSERT query. my save button is coded and not wizard created. i'm
using two insert queries because there are two tables to where i'm saving,
their link is the "ClientID".

e.g.
tblclient
ClientID - primary key
Lastname
Firstname
MI

tblanswer
AnswerID - primary
ClientID
A1
A2
A3

how do i code it that all data of tblAnswer is linked to tblclient through
ClientID?

.



Relevant Pages

  • Re: Microsoft JET Database Engine error 80040e10
    ... suppost to remove the "Set rspoll=" part or not. ... Response.Write strSQL ... but BEFORE the Execute statement (it's the Execute statement that is ... the use of concatenation to form sql statements (aka ...
    (microsoft.public.data.ado)
  • Re: Job Priority, QZDASOINIT
    ... STRSQL? ... Have you tried a STRDBMON to see where the 2 minutes is spent? ... This is one of the SQL statements I'm trying to run. ... > SQL Server with Access as our reporting tool. ...
    (comp.sys.ibm.as400.misc)
  • Re: How to create an append query that appends to more than one ta
    ... You could write some VBA code that executes a series of SQL statements. ... Dim strSql As String ... Is there anyway to combine multiple append querries in one ...
    (microsoft.public.access.queries)
  • Re: Cannot figure out error in asp code
    ... The easiest way to depug your SQL statements in asp is ... response.write strSQL ... - it plugs in all your variables in and you can check ...
    (microsoft.public.inetserver.asp.general)
  • Re: Run timer Error
    ... If I work with ADO in mdb, do you know if there is a way equivalent a DAO, I ... Dim DB As DAO.Database, strSQL As String ... primary key avoids duplication records. ...
    (microsoft.public.access.adp.sqlserver)