Here it is:
INSERT INTO HIPlanNames ( STATE, PlanName, FFS, HMO, PPO,
POS, [DEFAULT], SOURCE, CODE_TEST, DEFAULT_TEST,
ENROLLMENT, PPOInd, STAFF, IPA, NETWORK, [GROUP],
MEDICARE, MEDICAID, LastUpdated )
SELECT TOP 1 HIPlanNames.STATE, HIPlanNames.PlanName,
HIPlanNames.FFS, HIPlanNames.HMO, HIPlanNames.PPO,
HIPlanNames.POS, HIPlanNames.DEFAULT, HIPlanNames.SOURCE,
HIPlanNames.CODE_TEST, HIPlanNames.DEFAULT_TEST,
HIPlanNames.ENROLLMENT, HIPlanNames.PPOInd,
HIPlanNames.STAFF, HIPlanNames.IPA, HIPlanNames.NETWORK,
HIPlanNames.GROUP, HIPlanNames.MEDICARE,
HIPlanNames.MEDICAID, HIPlanNames.LastUpdated
FROM HIPlanNames
WHERE (((HIPlanNames.PlanID)=[Please enter the record
number you want to duplicate]));
One other thing. Is it possible to allow the user to put
multiple record numbers in the parameter for PlanID?
Thanks.
-----Original Message-----
Post the query that you had created so we can examine
what Access is seeing.
--
Rob
FMS Professional Solutions Group
http://www.fmsinc.com/consulting
Software Tools for .NET, SQL Server, Visual Basic & Access
http://www.fmsinc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
message
Hi,
I am very interested in this query. However, there seems
to be an error with this query syntax. Access is
saying "Syntax error (comma)in query expression"; then
it
list the fields. Can anybody help with this, please?
-----Original Message-----
If you know how to execute queries, this should be what
you need:
Insert into tblTable (field1, field2, ... fieldx)
Select Top 1 (field1, field2, ... fieldx)
From tblTable
Order By IDField Desc
When the user presses the command button, execute the
query. This will push
the previous record into the table. This happens
because
it takes the top
record (Top 1) from the table where you order the
records
in descending
order based on the Autonumber field.
HTH
--
Rob
FMS Professional Solutions Group
http://www.fmsinc.com/consulting
Software Tools for .NET, SQL Server, Visual Basic &
Access
http://www.fmsinc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
message
Thanks in advance! I have a simple form which
consists
of
only about 10 fields. I want the user to be able to
click
a command button and generate a new record with all
of
the
data from the most recent previous record as
default. My
primary key is an ID field.
.
.