Sounds like Access is identifying that name with something else.
Try aliasing the field with another name, e.g.:
12 AS MyLiteral
When Access gets the names of fields or tables muddled, Name AutoCorrect
is
the number one suspect:
http://allenbrowne.com/bug-03.html
mmm... did as you suggested.. it asks for the [ProposalID] parameter. i
provided "12" as the input - it then asked me if i wanted to append all
46
rows. there are only actually 6 rows associated with paramter 12... not
sure
why its asking me to confirm "append 46"... i have checked the data
types
and
they are all long integer.
:
Looks okay, assuming the data types match.
Create a new query.
Cancel the Add Table dialog.
Switch to SQL View (View menu.)
Paste the statement it.
Run.
What name parameter does Access ask for?
Does that give any clues?
i've checked my table field names and all ok. here is the output of
"strSQL"
from the "local" window when the fault occurs and I go to debug....
"INSERT INTO [tbl_ProposalAssetJunction] (jnc_ProposalID,
jnc_AssetID,
jnc_AssetPosition) SELECT 46 As jnc_ProposalID, jnc_AssetID,
jnc_AssetPosition FROM [tbl_ProposalAssetJunction] WHERE ProposalID
=
12;"
any ideas?
:
The request for a parameter means there is a name in the SQL
statement
that
JET cannot resolve. It might be a misspelled field name, or a
reference
to
something like [Forms].[Form1].[Text0].
It's fine to leave an AutoNumber field with no value assigned to
it.
(I'm
cautious with assuming Access will assign the default value for
other
fields, though, as I'm not sure this has been consistent across all
versions, service packs, and append methods.)
hi allen,
thanks for this- i think its "almost" there... when i run the
code,
i
keep
getting a "Runtime Error 3061: Too Few Parameters expected 1"
issue.
as part of my junction table, i have setup a field
"jnc_JunctionID"
which
is
an autonumber field. i have deliberately left this out of the SQL
statement
on the basis that, whatever fields are omitted from the SQL, the
default
will
be applied for the new record(s). even when i include that field
as
part
of
the statement, i still get the same error.
any ideas??
:
See:
Duplicate the record in form and subform
at:
http://allenbrowne.com/ser-57.html
i have a couple of tables with a "one-to-many" relationship.
i want enable my users to essentially "duplicate" the data
from a
parent
record into a new record, but also duplicate "child" records
associated
with
that parent, linking the duplicated child records to the newly
duplicated
"parent" record.
ideally, i would like to do this as the result of a command
button
"on
click" event.
however, i really have run out of ideas! can somebody help???