Eqauting two bounded text boxes

  • Thread starter Thread starter George Papadopoulos
  • Start date Start date
G

George Papadopoulos

Hello everybody


Say we have two forms each with a bounded text box of it`s own. I would
like to know how is it possible to set the value of the second text box
equal to the value of the first text box, using the integrated Visual Basic
for Applications language.

e.t.c. I would like by pressing a single button on the first form to pop
up (open) the second form and have the corresponding text boxes set to the
same value. More specifically, the second text box on the second form would
take the value of the first text box on the first form.


Any help would be appreciated

George Papadopoulos
 
The code to refer to a field on another form is:
Forms![formname].[fieldname]

You would put the assignment in the field's After Update event to set the value of the other field. This only works if both forms are open.


--
Karen Stern
A Little Help Computer Services, LLC
www.alittlehelp.net
(e-mail address removed)
518-885-4549
Everyone Needs A Little Help!
 
George,

You posted another one on this earlier this morning, see my reply to that
one.

A word of caution (which I missed in the previous reply): both text boxes
bound? You need to make sure you advance the second form to a new record
BEFORE you pull accross the visit code, otherwise you will overwrite the
first existing record in the underlying table!

stDocName = "STOIXEIA_ANTALLAKTIKWN"
DoCmd.OpenForm stDocName
DoCmd.GoToRecord, acNewRec

[Forms].stDocName.[Visit Code].SetFocus
[Forms].stDocName.[Visit Code] = varvc

HTH,
Nikos
 
thx. Nikos. The general idea is that when I press the button on the first
form, I get to add a new record to the table bounded to the second form.
When I modify the code this way I get yet another error 'The object '5'
isn`t open'. This is getting a bit annoying.

Am I still missing something?

Ï "Nikos Yannacopoulos said:
George,

You posted another one on this earlier this morning, see my reply to that
one.

A word of caution (which I missed in the previous reply): both text boxes
bound? You need to make sure you advance the second form to a new record
BEFORE you pull accross the visit code, otherwise you will overwrite the
first existing record in the underlying table!

stDocName = "STOIXEIA_ANTALLAKTIKWN"
DoCmd.OpenForm stDocName
DoCmd.GoToRecord, acNewRec

[Forms].stDocName.[Visit Code].SetFocus
[Forms].stDocName.[Visit Code] = varvc

HTH,
Nikos

George Papadopoulos said:
Hello everybody


Say we have two forms each with a bounded text box of it`s own. I would
like to know how is it possible to set the value of the second text box
equal to the value of the first text box, using the integrated Visual Basic
for Applications language.

e.t.c. I would like by pressing a single button on the first form to pop
up (open) the second form and have the corresponding text boxes set to the
same value. More specifically, the second text box on the second form would
take the value of the first text box on the first form.


Any help would be appreciated

George Papadopoulos
 
Back
Top