Field as Reference

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Background: I have a form with multiple tabs. I'd like
the "last name" field to be in two different places.
Once I've entered in the first "last name" field, I'd
like it to automatically appear in the second.

Problem: Right now, the second "last name" field does
calculate properly to show the correct information.
However, it only does so as I leave the record. How do I
get it to appear immediately?

Many thanks!
 
Background: I have a form with multiple tabs. I'd like
the "last name" field to be in two different places.
Once I've entered in the first "last name" field, I'd
like it to automatically appear in the second.

Problem: Right now, the second "last name" field does
calculate properly to show the correct information.
However, it only does so as I leave the record. How do I
get it to appear immediately?

Many thanks!

What is the Control Source of the textbox? How are you "calculating" a
last name?
 
So, the lastname field is in txtLastName1 and txtLastName2 (for example).

If txtLastName1 and txtLastName2 are both bound to the same field in the
form's recordset, updating one of them should definitely update the other
one - instantly - as far as I can remember (but I don't have Access here to
check).

But if txtLastName1 and/or txtLastName2 are >un<bound - that is, one or both
of them do not have fieldnames in their controlsourceproperties - then, you
must update the "other" value via VBA code in the form module. Perhaps
that's the case, & the "other" field is being updated by code in the
Form_BeforeUpdate event? (That code would not fire until you tried to leave
the record.) If so, you'd have to move the appropriate part of that code
to - or duplicate it in - the AfterUpdate event of txtLastName1.

HTH,
TC
 
-----Original Message-----


What is the Control Source of the textbox? How are you "calculating" a
last name?


.

In my table, I have "last name" and "last name 2". The
control source for both is "last name". I say the word
calculating because that is what the bottom left reads
when I leave the record.

"Last Name 2" does appear correctly...but not until I
leave the record and then come back. Is there any way I
can get it to appear instantly?
 
In my table, I have "last name" and "last name 2". The
control source for both is "last name". I say the word
calculating because that is what the bottom left reads
when I leave the record.

I'm sorry, that seems to be contradictory. You say "you have fields
[last name] and [last name 2] in your Table - but that the Control
Source for both is [last name].

A Control on a Form has a Control Source, which is the name of a field
in the table. Do you have two textboxes with the same Control Source?
or two table fields bound to different Form controls? or something
else?
"Last Name 2" does appear correctly...but not until I
leave the record and then come back. Is there any way I
can get it to appear instantly?

AT A WILD GUESS... put the following VBA code in the first textbox's
AfterUpdate event:

Private Sub Last_Name_AfterUpdate()
Me![Last Name 2].Requery
End Sub

but I'm still puzzled at your table structure.
 
John Vinson said:
In my table, I have "last name" and "last name 2". The
control source for both is "last name". I say the word
calculating because that is what the bottom left reads
when I leave the record.

I'm sorry, that seems to be contradictory. You say "you have fields
[last name] and [last name 2] in your Table - but that the Control
Source for both is [last name].

A Control on a Form has a Control Source, which is the name of a field
in the table. Do you have two textboxes with the same Control Source?
or two table fields bound to different Form controls? or something
else?
"Last Name 2" does appear correctly...but not until I
leave the record and then come back. Is there any way I
can get it to appear instantly?

AT A WILD GUESS... put the following VBA code in the first textbox's
AfterUpdate event:

Private Sub Last_Name_AfterUpdate()
Me![Last Name 2].Requery
End Sub

but I'm still puzzled at your table structure.


I believe he just wants to see the same field at two different places on the
form. So "last name" and "last name 2" are two controls that are both bound
to the same field, "last name". He types a value into the "last name"
control, & expects to see that value appear in the "last name 2" control
before< he leaves the record.

IMO, that's exactly what should happen. So either I have misunderstood what
he's doing, or he has mis-described it, or ... ?

Don't have Access here to check ... grrr!

Cheers,
TC
 
Back
Top