passing value from a form to another form

R

Rani

HI guys

I have a form (Choze_FRM) containing a combo box (CustNameCombo) I defined
an On Not In List event that opens another form (AddCustFRM) first field on
that form is CustName,
I am using an on get focus event to pass the value entered on the combo box
to the new field.
I'm using :
Private Sub CustName_GotFocus()
CustName = Forms![Choze_Frm]![CustNameCombo]
End Sub.

and I am not getting anything.

can you guys tell me what am I doing wrong ?
 
J

Jan Pit

Rani,

In the OnNotInlist event put before opening the second form, the
instruction:
Me.Tag = NewData
For the second form use maybe rahter OnOpen (for me OnFocus does not
happen!!?!),
then put there:
Text0.Value=Forms!FrmTest1!Tag

You must still handle the result of the first form with "Response = ..."
(maybe depending on the users choice in the second form).

HTH

+ Jan Pit +
Botswana
 
R

Rani

thanks.

Jan Pit said:
Rani,

In the OnNotInlist event put before opening the second form, the
instruction:
Me.Tag = NewData
For the second form use maybe rahter OnOpen (for me OnFocus does not
happen!!?!),
then put there:
Text0.Value=Forms!FrmTest1!Tag

You must still handle the result of the first form with "Response = ..."
(maybe depending on the users choice in the second form).

HTH

+ Jan Pit +
Botswana


Rani said:
HI guys

I have a form (Choze_FRM) containing a combo box (CustNameCombo) I defined
an On Not In List event that opens another form (AddCustFRM) first field on
that form is CustName,
I am using an on get focus event to pass the value entered on the combo box
to the new field.
I'm using :
Private Sub CustName_GotFocus()
CustName = Forms![Choze_Frm]![CustNameCombo]
End Sub.

and I am not getting anything.

can you guys tell me what am I doing wrong ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top