Re: Define FROM target in Append Query

From: Duane Hookom (duanehookom_at_NO_SPAMhotmail.com)
Date: 02/15/04


Date: Sun, 15 Feb 2004 14:49:43 -0600

Assuming you have code in the form frmProcessEditor perhaps you place code
in the after update event of tbxNewTable.

Dim db as DAO.Database
Dim qdf as DAO.QueryDef
Dim strSQL as String
Set db = CurrentDb
Set qdf = db.QueryDefs("qappQuery")
strSQL = "INSERT INTO [" & Me.tbxNewTable & "] ( PageKey, ShapeKey,
ShapeText )" & _
        "SELECT tblP1.PageKey, tblP1.ShapeKey, tblP1.ShapeText " & _
        "FROM tblP1 " & _
        "WHERE PageKey=forms.frmProcessEditor.tbxPageKey " & _
        "And ShapeKey =forms.frmProcessEditor.tbxShapeKey " & _
        "And ShapeText=forms.frmProcessEditor.tbxShapeText;"
qdf.SQL = strSQL
Set qdf = Nothing
Set db = Nothing

You could resolve the other references to the form. I didn't do this since I
wasn't aware of the data types.

-- 
Duane Hookom
MS Access MVP
"rbrandt" <rbrandt2@flash.net> wrote in message
news:0EDA856B-8B6C-48A5-BABB-B2AFF16DF2C2@microsoft.com...
> Can you tell me/show me more please.  Example?
> thanx


Relevant Pages

  • Re: Querydef
    ... Dim qdf As DAO.QueryDef ... Dim fld As DAO.Field ... Set qdf = db.QueryDefs ...
    (microsoft.public.access.modulesdaovba)
  • Re: Querydef
    ... Dim qdf As DAO.QueryDef ... Dim fld As DAO.Field ... Set qdf = db.QueryDefs ...
    (microsoft.public.access.modulesdaovba)
  • Re: Querydef
    ... Dim qdf As DAO.QueryDef ... Dim fld As DAO.Field ... Set qdf = db.QueryDefs ...
    (microsoft.public.access.modulesdaovba)
  • Re: Querydef
    ... Dim qdf As DAO.QueryDef ... Dim fld As DAO.Field ... Set qdf = db.QueryDefs ...
    (microsoft.public.access.modulesdaovba)
  • Re: Export multiple versions of a query to separate Excel files
    ... Dim qdf As DAO.QueryDef ... ' *** code to set strSQL needs to be changed to conform to your ... ' with the real names of the EmployeesTable table and the ManagerID ...
    (microsoft.public.access.externaldata)