insert into

I have created this query:
INSERT INTO versamenti2 ( codice_iscrizione, riferimento )
SELECT codice_iscrizione, rif
FROM iscrizioni;
I want that only the current record is appended in the table
iscrizioni2

thanks
by
nicolacantalupo [ Fr, 18 Januar 2008 10:22 ] [ ID #1911361 ]

Re: insert into

"nicolacantalupo" <nicolacantalupo [at] libero.it> wrote

>I have created this query:
> INSERT INTO versamenti2 ( codice_iscrizione, riferimento )
> SELECT codice_iscrizione, rif
> FROM iscrizioni;
> I want that only the current record is appended in the table
> iscrizioni2

What "current record"?

If from a Form, you should be able to obtain from the Form or the Form's
RecordSource the unique identifer of the Form's current record, and use it
to construct a WHERE or HAVING clause in your SQL.

Larry Linson
Microsoft Access MVP
Larry Linson [ Fr, 18 Januar 2008 20:53 ] [ ID #1911392 ]

Re: insert into

On Fri, 18 Jan 2008 19:53:14 GMT, "Larry Linson"
<bouncer [at] localhost.not> wrote:

Larry is right. A SQL statement like:
INSERT INTO versamenti2 ( codice_iscrizione, riferimento )
SELECT codice_iscrizione, rif
FROM iscrizioni
WHERE <primarykey> = Forms!YourFormName!YourPrimaryKeyField

will update just a single row.
The HAVING clause is reserved for GROUP BY situations - not your
problem at this time.

-Tom.



>"nicolacantalupo" <nicolacantalupo [at] libero.it> wrote
>
>>I have created this query:
>> INSERT INTO versamenti2 ( codice_iscrizione, riferimento )
>> SELECT codice_iscrizione, rif
>> FROM iscrizioni;
>> I want that only the current record is appended in the table
>> iscrizioni2
>
>What "current record"?
>
>If from a Form, you should be able to obtain from the Form or the Form's
>RecordSource the unique identifer of the Form's current record, and use it
>to construct a WHERE or HAVING clause in your SQL.
>
> Larry Linson
> Microsoft Access MVP
>
Tom van Stiphout [ Sa, 19 Januar 2008 07:04 ] [ ID #1911992 ]
Datenbanken » comp.databases.ms-access » insert into

Vorheriges Thema: installing access 2007 with 2000 and 97
Nächstes Thema: Error in my code: tried to print to pdf using pdf printer on network