By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,462 Members | 2,394 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,462 IT Pros & Developers. It's quick & easy.

Question about tab control

P: n/a
I have an unbound form, and on the form is a tab control with 6 pages.
I have a function which fills the fields with data when the form is
opened, and another to save everything when it is closed.

Here's the question - in a couple of instances I want the same field
to appear on 2 pages. So the 2 fields need to have slightly different
names, but even so, no problem with the initial loading of data. But
then I want to arrange it so that if a user changes the contents of
that field on one page then that change is immediately echoed to the
same field on the other page. I can't get this to work using either
Before or After Update.

Can anyone help with this please.

TIA Dave

Feb 19 '07 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Dave G @ K2 wrote:
I have an unbound form, and on the form is a tab control with 6 pages.
I have a function which fills the fields with data when the form is
opened, and another to save everything when it is closed.

Here's the question - in a couple of instances I want the same field
to appear on 2 pages. So the 2 fields need to have slightly different
names, but even so, no problem with the initial loading of data. But
then I want to arrange it so that if a user changes the contents of
that field on one page then that change is immediately echoed to the
same field on the other page. I can't get this to work using either
Before or After Update.

Can anyone help with this please.

TIA Dave
Just a thought. Place those controls on the form itself rather than a TabPage.
Then one control will appear on all pages. You can use the Change event of the
TabControl to hide the controls on certain pages.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Feb 19 '07 #2

P: n/a
Rick

Good thought, and I don't want to sound ungrateful, but I don't think
this is viable because of the positions of the various instances of
the fields in question

Dave

Feb 19 '07 #3

P: n/a
Why don't you just use the same control?

Drag and drop the field name from the field list into the first page
and the second page. The field automatically 'updates' because it's
pulling data from the same place.

As long as the data source for the control is the same field, it will
contain the same information at all times. No requery required.

Feb 19 '07 #4

P: n/a
ch************@yahoo.com wrote:
Why don't you just use the same control?

Drag and drop the field name from the field list into the first page
and the second page. The field automatically 'updates' because it's
pulling data from the same place.

As long as the data source for the control is the same field, it will
contain the same information at all times. No requery required.
This is an *unbound* form he is talking about.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Feb 19 '07 #5

P: n/a
...... But
then I want to arrange it so that if a user changes the contents of
that field on one page then that change is immediately echoed to the
same field on the other page. I can't get this to work using either
Before or After Update.

Can anyone help with this please.

TIA Dave
I think this is the easiest way, but the only reason I can think of
for it not to work is that when in use, the field is not finished
being updated before you look at the other, or that either one is in
the proccess of being updated and can't be changed at that time. You
could try making the control to lose focus so that the update is
forced when moving between pages. In the each pages On Change event,
set the focus to a control that is not one of the two in question.
This should force them to update, but you may need handle invalid
entries first (ie. text in a date field).
In the AfterUpdate events, say Me!Fieldl1=Me!Field2 and vice versa.

Feb 20 '07 #6

P: n/a
On Feb 19, 7:13 pm, "storrboy" <storr...@sympatico.cawrote:
..... But
then I want to arrange it so that if a user changes the contents of
that field on one page then that change is immediately echoed to the
same field on the other page. I can't get this to work using either
Before or After Update.
this worked in A2000/2003:

Private Sub Text5_AfterUpdate()
Text7 = Text5
End Sub

Private Sub Text7_AfterUpdate()
Text5 = Text7
End Sub

What version are you using? -tc

Feb 20 '07 #7

P: n/a
Thanks everyone

I'm using Access 2003.

One of the fields is a combo box and I've found that the After Update
event fires here and that's where I have put my code to copy from A to
B.
On another field I have just used the Lost Focus event to copy the
value across

Dave

Feb 20 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.