Duplicate Record Entry

  • Thread starter Thread starter Lorence
  • Start date Start date
L

Lorence

I have a form with a sub-form inside it
Basically if a choose a location the sub-form expands to show whatever
items are in that location

It must be simple, but having looked at all the sites I know, I can
not find how to set upo a button so that when pressed it inserts a
duplicate record for whatever one the cursor is on.

I am obviously missing something somewhere.

Lorence
 
You simply set the [Link Master Fields] and [Link Child Fields] Property of
the SubForm Control to corresponding Fields in the One Table and the Many
Table and Access will do filter the Subform automatically for you.

Check your Access books / Access Help on Subforms and the above Properties.
 
You simply set the [Link Master Fields] and [Link Child Fields] Property of
the SubForm Control to corresponding Fields in the One Table and the Many
Table and Access will do filter the Subform automatically for you.

Check your Access books / Access Help on Subforms and the above Properties.


Sorry didn't make it clear - The Form/Subform part works fine - Have
used it ever since Access 97 or whatever it was then

Can't write the macro to insert a duplicate record tho'

I can do it via

<Select record>
<copy>
<Paste Append>

But eventually the data entry person will not be Access friendly, so I
need to create a button to do this for them


Lorence
 
Sorry, it is my mistake. Your post is entirely clear.

I am not sure whether I meant to answer another post (more likely) or I was
half asleep and didn't read you post correctly.

There are plenty of ways to duplicate a Record current show on the Subform.

1. You can use a dynamic "INSERT INTO ...." SQL String (equivalent to an
Append Query) constructed from the data of the Subform Current Record and
the use the Execute Method of the Database object to execute the SQL String.
This is more or less DAO code and you can also use the equivalent ADODB
code.

Alternatively, you can use the RunSQL Method of the DoCmd Object to execute
the SQL String.

2. You can use the Recordset (both DAO & ADO) object to add a new Record
into the Table also. The data again comes from the Subform Current Record.

Check Access / VB Help on the special terms I referred to above.
--
HTH
Van T. Dinh
MVP (Access)


Lorence said:
You simply set the [Link Master Fields] and [Link Child Fields] Property
of
the SubForm Control to corresponding Fields in the One Table and the Many
Table and Access will do filter the Subform automatically for you.

Check your Access books / Access Help on Subforms and the above
Properties.


Sorry didn't make it clear - The Form/Subform part works fine - Have
used it ever since Access 97 or whatever it was then

Can't write the macro to insert a duplicate record tho'

I can do it via

<Select record>
<copy>
<Paste Append>

But eventually the data entry person will not be Access friendly, so I
need to create a button to do this for them


Lorence
 
Sorry, it is my mistake. Your post is entirely clear.

I am not sure whether I meant to answer another post (more likely) or I was
half asleep and didn't read you post correctly.
Think I've got that tee-shirt myself!!

Thks for reply.

Unfortunately, despite using computers since 1968 (It was punch tape
then) my knowledge of what you answered is zero!

Don't even know where to start. Looked up the help pages, both on
computer & M/soft and various 'Access Tips' web-sites, but will have
to go to bottom of the class.

Lorence
 
I find that if I don't know basic ops of a software, Help doesn't help
because it is written for users who already have basic knowledge. Web sites
and "Access Tips" are for tidbits of info. tending to concentrate on some
specific aspects. None of the above is for structured learning /
understanding. I probably read about 3 books before I got a good grasp of
Access (1 for basic GUI ops, 1 for VBA programming and 1 for advanced
topic).

If you really want to learn Access, nothing compares to a good Access book.
John Viescas "Access Inside Out" comes to my mind as well as Roger Jennings'
"Using Access {version}"
 
Back
Top