Copying a record on a Continuous Forms form

  • Thread starter Thread starter BobRoyAce
  • Start date Start date
B

BobRoyAce

I have a form whose Default View is specified to be Continous Forms. In the
detail section I have a row of edit controls, some of which are bound to a
datasource and some of which are not. Additionally, I have a little button
(to the far left) that appears for each record. What I want to do, when the
user clicks on this button, is copy the record on the "line" it's on and
append it to table. I will not be copying all of the fields on the existing
record into the new one...just certain fields.

My question is twofold: First, How can I know which record to copy since
there could be several records being displayed? In other words, how will I
know which button they clicked on? Second, how would I actually make
something like this happen?
 
Access has no way to manage individual values for unbound controls on
different rows of a continuous form.

If you need a different value for each row:
- move the control into the Form Footer section if you just need it to refer
to the current row,
OR
- base the continuous form on a query with a calculated field to show the
appropriate value on each row if it can be read-only,
OR
- bind the control to a field if it needs to be edited.
 
Not at all.

Assuming you have some kind of unique identifier on each row (e.g. the
primary key value of the continuous form's table), that value will tell you
the current row.

Or, if the user has selected multiple rows, use SelStart and SelHeight.
 
I guess what I'm trying to ask is...

On my form, I have only one button. Therefore, I'm thinking there will, of
course, only be one OnClick event sub. However, this button appears mutliple
times...once for each record at runtime. When I click on a button, does it
automatically make the record on the line where it exists the active record?
 
Yes.

In order for the focus to move to that button, that record has to become the
current record.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

BobRoyAce said:
I guess what I'm trying to ask is...

On my form, I have only one button. Therefore, I'm thinking there will, of
course, only be one OnClick event sub. However, this button appears mutliple
times...once for each record at runtime. When I click on a button, does it
automatically make the record on the line where it exists the active
record?
 
Back
Top