How to update a secondary form field by a primary one ?

A

arnicot

I have a form with a primary part and a secondary part. (sub form)
I'd like to duplicate the date which is on the primary form into a field
on the secondary form in order to update it.
In addition, I'd like to control this update by clicking any field of
the selected row before the update would be processed.
Any clue ?

Thanks.
 
M

MacDermott

Pardonnez-moi, but that sounds like a really odd request.
Let's see if I've understood you correctly:
You have a main form, which displays the information from a single record of
a table.
In addition, you have a subform, which displays several rows of information,
presumably from a different table.
Now, on each row of the subform, you want to display at least one field of
information from the main form, so that the same information will be
repeated on each row of the subform.
You want to be able to update this information -
I presume you understand that this will cause the information displayed
in all rows to change.
In addition, you specify that you must click a field (different from the one
you just updated?) on the selected row (of the subform), before this update
will be processed.
Does that mean that if you exit the subform (e.g. return focus to the
main form) without clicking on something else on the same row in the
subform, the update will be undone?

This is an extremely puzzling picture to me.
Could you let us in on a bit of your motivation in trying to develop this
scenario?
 
A

arnicot

MacDermott a écrit :

You have a main form, which displays the information from a single record of
a table. Yes
In addition, you have a subform, which displays several rows of information,
presumably from a different table. Correct
Now, on each row of the subform, you want to display at least one field of
information from the main form, so that the same information will be
repeated on each row of the subform.

Not exactly.
The main form represents the general information of a library stock and
the subform the detailed information for each book. There are several
library stocks, that's why I have a "father" table and a "son" table.
From time to time we review a library to check the position having no
stock left.
For those positions, instead of keying in the review date, we'd just
like to click somewhere on the corresponding row to automatically copy
the date we entered on the main form as a parameter.
I played with the source properties of my form, but without any success
so far!
This is an extremely puzzling picture to me.
Could you let us in on a bit of your motivation in trying to develop this
scenario?

I hope it's a bit clearer to you now. (be indulgent to me: I am a newbie
in access)

Thanks for your help.
 
M

MacDermott

So, let's say we use a button on the subform.
Clicking on that button will enter a (date reviewed) value in the record for
that subform row.
The value which will be entered into the subform row is read from the main
form.

Am I closer now?

- Turtle
 
A

arnicot

MacDermott a écrit :
So, let's say we use a button on the subform.
Clicking on that button will enter a (date reviewed) value in the record for
that subform row.
The value which will be entered into the subform row is read from the main
form.

Am I closer now?

- Turtle

Yes, but if I've well understood, I'd have:
1° to select the row on which the date has to be updated
2° click on the button to validate the process
Am I right ?
Ideally, I'd like to combine these 2 steps in only one: the click,
anywhere on a row, would update the date field of that row by the value
which is stored in the main form as a parameter. Do you see what I mean?
Thanks again for your help.
 
M

MacDermott

Since there's a button on each row, simply clicking the button will perform
both tasks - select the row and click the button.
Each control on the subform has its own Click event, so if you want to be
able to click anywhere in the row, you'd have to connect to the Click event
of each control - as well as the Detail section itself, to allow for clicks
on the background.
Besides, a button which says UPDATE is pretty clear to the user, whereas
giving them the same (non-standard) effect from clicking anywhere on the
subform is going to need some explaining...

Or did you want the field updated every time a user makes a change to a row?
 
A

arnicot

MacDermott a écrit :
Since there's a button on each row, simply clicking the button will perform
both tasks - select the row and click the button.

OK, I thought there was only a button for all the subform rows. That's
why I was talking about a selection step and then an other one for
launching the process by pushing the button.
Each control on the subform has its own Click event, so if you want to be
able to click anywhere in the row, you'd have to connect to the Click event
of each control - as well as the Detail section itself, to allow for clicks
on the background.
Besides, a button which says UPDATE is pretty clear to the user, whereas
giving them the same (non-standard) effect from clicking anywhere on the
subform is going to need some explaining...

OK you're right. I agree with your advice. I don't know yet exactly how
to program that but I'm gonna work that way.
Or did you want the field updated every time a user makes a change to a row?

Thanks for all.
Bye
 
M

MacDermott

We'll look for your next posts!

arnicot said:
MacDermott a écrit :

OK, I thought there was only a button for all the subform rows. That's
why I was talking about a selection step and then an other one for
launching the process by pushing the button.


OK you're right. I agree with your advice. I don't know yet exactly how
to program that but I'm gonna work that way.
row?

Thanks for all.
Bye
 
Top