insert into

insert into

am 18.01.2008 10:22:51 von nicolacantalupo

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

Re: insert into

am 18.01.2008 20:53:14 von Larry Linson

"nicolacantalupo" 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

Re: insert into

am 19.01.2008 07:04:47 von Tom van Stiphout

On Fri, 18 Jan 2008 19:53:14 GMT, "Larry Linson"
wrote:

Larry is right. A SQL statement like:
INSERT INTO versamenti2 ( codice_iscrizione, riferimento )
SELECT codice_iscrizione, rif
FROM iscrizioni
WHERE = 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" 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
>