passing values between forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that calls another form with this:
DoCmd.OpenForm "frm_Scenarios_BasicData", acDialog, , , acFormEdit

So when I have frm_Scenario, i need to be able to doble clik on a row which
value should be sent to the first form.
I have tried this with no result:
Forms![frm_PPL]![frm_Control]![frm_BasicData_BasicData].Form![txt_Scenario]
= Me.Id

Please HELP!!
 
Pass the value in the OpenArgs argument, and then write it to the correct
control in the second form:

In the first form:

DoCmd.OpenForm "frm_Scenarios_BasicData", acDialog, , , acFormEdit, ,Me.Id


In the second form's Load event:

If Len(Me.OpenArgs & "") > 0 Then _
Forms![frm_PPL]![frm_Control]![frm_BasicData_BasicData].Form![txt_Scenario]
= Me.OpenArgs
 
Thanks a lot for helping me.

I do not know if don't understand, but what I need is to pass a value from
the second form to the first one.

My first form is frm_BasicData_BasicData, which is opened from frm_PPL with
an Opensource inside an frm_Control. Then from frm_BasicData_BasicData i call
frm_Scenario_BasicData.

From this last form, I want to pass a value to the frm_BasicData_BasicData
which is in frm_PPL.

Thanks a lot, Lina

Ken Snell (MVP) said:
Pass the value in the OpenArgs argument, and then write it to the correct
control in the second form:

In the first form:

DoCmd.OpenForm "frm_Scenarios_BasicData", acDialog, , , acFormEdit, ,Me.Id


In the second form's Load event:

If Len(Me.OpenArgs & "") > 0 Then _
Forms![frm_PPL]![frm_Control]![frm_BasicData_BasicData].Form![txt_Scenario]
= Me.OpenArgs


--

Ken Snell
<MS ACCESS MVP>

Lina Manjarres said:
I have a form that calls another form with this:
DoCmd.OpenForm "frm_Scenarios_BasicData", acDialog, , , acFormEdit

So when I have frm_Scenario, i need to be able to doble clik on a row
which
value should be sent to the first form.
I have tried this with no result:
Forms![frm_PPL]![frm_Control]![frm_BasicData_BasicData].Form![txt_Scenario]
= Me.Id

Please HELP!!
 
Sorry, I misunderstood. What I posted doesn't do this.

Your expression that you showed is generally in the right direction. From
it, it appears that you're trying to write the value from the "second" form
(frm_Scenario_BasicData) to a subform within a subform on the first form
(frm_PPL). Thus, most likely the problem you're having is the correct names
to use for the subform references. In ACCESS, you must use the name of the
subform control (the control that holds the subform), which may or may not
be the same name as the actual source object (the actual form) that is
serving as the subform.

You can check the Name property of the subform controls in the Properties
window. Here is the general syntax to reference a control on a subform in a
subform in a form:

Forms!NameOfMainForm!NameOfSubformControl!NameOfSubformSubformControl!NameOfControlOnSubformSubform

--

Ken Snell
<MS ACCESS MVP>


Lina Manjarres said:
Thanks a lot for helping me.

I do not know if don't understand, but what I need is to pass a value from
the second form to the first one.

My first form is frm_BasicData_BasicData, which is opened from frm_PPL
with
an Opensource inside an frm_Control. Then from frm_BasicData_BasicData i
call
frm_Scenario_BasicData.

From this last form, I want to pass a value to the frm_BasicData_BasicData
which is in frm_PPL.

Thanks a lot, Lina

Ken Snell (MVP) said:
Pass the value in the OpenArgs argument, and then write it to the correct
control in the second form:

In the first form:

DoCmd.OpenForm "frm_Scenarios_BasicData", acDialog, , , acFormEdit,
,Me.Id


In the second form's Load event:

If Len(Me.OpenArgs & "") > 0 Then _

Forms![frm_PPL]![frm_Control]![frm_BasicData_BasicData].Form![txt_Scenario]
= Me.OpenArgs


--

Ken Snell
<MS ACCESS MVP>

message
I have a form that calls another form with this:
DoCmd.OpenForm "frm_Scenarios_BasicData", acDialog, , , acFormEdit

So when I have frm_Scenario, i need to be able to doble clik on a row
which
value should be sent to the first form.
I have tried this with no result:
Forms![frm_PPL]![frm_Control]![frm_BasicData_BasicData].Form![txt_Scenario]
= Me.Id

Please HELP!!
 
I send this againf, becasue I am not sure if I sent it at all


You are correct, mine is a syntax problem, but it doesn't work at all.
I have tried what you recomended me, but it did not work.
I will explain my forms, so you can see where the problem is.

MainForm= frm_PPL
inside frm_PP I have an empty form called frm_Control
then I use this instrucción to call the next form inside frm_Control

Me.frm_Control2.SourceObject = "frm_BasicData_BasicData"
when I insert a new row in this form it calls the next form if some condition

DoCmd.OpenForm "frm_Scenarios_BasicData", acDialog, , , acFormAdd

so when frm_Scenarios_BasicData is opened, I doubleclick on one row.
What I want is to be able to pass the Id of this row to the
frm_BasicData_BasicData

I have try all the combinations possible, but none of them works.
Some times it says that the form does not exists or that control does not
accept this...

Examples of what I have tried:

Forms!frm_PPL!frm_Control.Form!frm_BasicData_BasicData.txt_Scenario = Me.Id
Forms!frm_PPL!frm_Control!frm_BasicData_BasicData.txt_Scenario = Me.Id
Forms!frm_PPL!frm_BasicData_BasicData.txt_Scenario = Me.Id
error message: can't find field frm_BasicData_BasicData


Ken Snell (MVP) said:
Sorry, I misunderstood. What I posted doesn't do this.

Your expression that you showed is generally in the right direction. From
it, it appears that you're trying to write the value from the "second" form
(frm_Scenario_BasicData) to a subform within a subform on the first form
(frm_PPL). Thus, most likely the problem you're having is the correct names
to use for the subform references. In ACCESS, you must use the name of the
subform control (the control that holds the subform), which may or may not
be the same name as the actual source object (the actual form) that is
serving as the subform.

You can check the Name property of the subform controls in the Properties
window. Here is the general syntax to reference a control on a subform in a
subform in a form:

Forms!NameOfMainForm!NameOfSubformControl!NameOfSubformSubformControl!NameOfControlOnSubformSubform

--

Ken Snell
<MS ACCESS MVP>


Lina Manjarres said:
Thanks a lot for helping me.

I do not know if don't understand, but what I need is to pass a value from
the second form to the first one.

My first form is frm_BasicData_BasicData, which is opened from frm_PPL
with
an Opensource inside an frm_Control. Then from frm_BasicData_BasicData i
call
frm_Scenario_BasicData.

From this last form, I want to pass a value to the frm_BasicData_BasicData
which is in frm_PPL.

Thanks a lot, Lina

Ken Snell (MVP) said:
Pass the value in the OpenArgs argument, and then write it to the correct
control in the second form:

In the first form:

DoCmd.OpenForm "frm_Scenarios_BasicData", acDialog, , , acFormEdit,
,Me.Id


In the second form's Load event:

If Len(Me.OpenArgs & "") > 0 Then _

Forms![frm_PPL]![frm_Control]![frm_BasicData_BasicData].Form![txt_Scenario]
= Me.OpenArgs


--

Ken Snell
<MS ACCESS MVP>

message
I have a form that calls another form with this:
DoCmd.OpenForm "frm_Scenarios_BasicData", acDialog, , , acFormEdit

So when I have frm_Scenario, i need to be able to doble clik on a row
which
value should be sent to the first form.
I have tried this with no result:
Forms![frm_PPL]![frm_Control]![frm_BasicData_BasicData].Form![txt_Scenario]
= Me.Id

Please HELP!!
 
Hello Ken

I think my problem has to be with the recorsource of the
frm_BasicData_BasicData,
because it dosn't have the txt_Scenario as part of the query. txt_Scenario
is a textbox. Do you think this is the problem?

Thanks a lot, Lina

Ken Snell (MVP) said:
Sorry, I misunderstood. What I posted doesn't do this.

Your expression that you showed is generally in the right direction. From
it, it appears that you're trying to write the value from the "second" form
(frm_Scenario_BasicData) to a subform within a subform on the first form
(frm_PPL). Thus, most likely the problem you're having is the correct names
to use for the subform references. In ACCESS, you must use the name of the
subform control (the control that holds the subform), which may or may not
be the same name as the actual source object (the actual form) that is
serving as the subform.

You can check the Name property of the subform controls in the Properties
window. Here is the general syntax to reference a control on a subform in a
subform in a form:

Forms!NameOfMainForm!NameOfSubformControl!NameOfSubformSubformControl!NameOfControlOnSubformSubform

--

Ken Snell
<MS ACCESS MVP>


Lina Manjarres said:
Thanks a lot for helping me.

I do not know if don't understand, but what I need is to pass a value from
the second form to the first one.

My first form is frm_BasicData_BasicData, which is opened from frm_PPL
with
an Opensource inside an frm_Control. Then from frm_BasicData_BasicData i
call
frm_Scenario_BasicData.

From this last form, I want to pass a value to the frm_BasicData_BasicData
which is in frm_PPL.

Thanks a lot, Lina

Ken Snell (MVP) said:
Pass the value in the OpenArgs argument, and then write it to the correct
control in the second form:

In the first form:

DoCmd.OpenForm "frm_Scenarios_BasicData", acDialog, , , acFormEdit,
,Me.Id


In the second form's Load event:

If Len(Me.OpenArgs & "") > 0 Then _

Forms![frm_PPL]![frm_Control]![frm_BasicData_BasicData].Form![txt_Scenario]
= Me.OpenArgs


--

Ken Snell
<MS ACCESS MVP>

message
I have a form that calls another form with this:
DoCmd.OpenForm "frm_Scenarios_BasicData", acDialog, , , acFormEdit

So when I have frm_Scenario, i need to be able to doble clik on a row
which
value should be sent to the first form.
I have tried this with no result:
Forms![frm_PPL]![frm_Control]![frm_BasicData_BasicData].Form![txt_Scenario]
= Me.Id

Please HELP!!
 
Hello Ken

I found a workoround.
I moved the txt_Scenario to the frm_BasicData_BasicData form...

Now it works

Thanks a lot!
Lina


Ken Snell (MVP) said:
Sorry, I misunderstood. What I posted doesn't do this.

Your expression that you showed is generally in the right direction. From
it, it appears that you're trying to write the value from the "second" form
(frm_Scenario_BasicData) to a subform within a subform on the first form
(frm_PPL). Thus, most likely the problem you're having is the correct names
to use for the subform references. In ACCESS, you must use the name of the
subform control (the control that holds the subform), which may or may not
be the same name as the actual source object (the actual form) that is
serving as the subform.

You can check the Name property of the subform controls in the Properties
window. Here is the general syntax to reference a control on a subform in a
subform in a form:

Forms!NameOfMainForm!NameOfSubformControl!NameOfSubformSubformControl!NameOfControlOnSubformSubform

--

Ken Snell
<MS ACCESS MVP>


Lina Manjarres said:
Thanks a lot for helping me.

I do not know if don't understand, but what I need is to pass a value from
the second form to the first one.

My first form is frm_BasicData_BasicData, which is opened from frm_PPL
with
an Opensource inside an frm_Control. Then from frm_BasicData_BasicData i
call
frm_Scenario_BasicData.

From this last form, I want to pass a value to the frm_BasicData_BasicData
which is in frm_PPL.

Thanks a lot, Lina

Ken Snell (MVP) said:
Pass the value in the OpenArgs argument, and then write it to the correct
control in the second form:

In the first form:

DoCmd.OpenForm "frm_Scenarios_BasicData", acDialog, , , acFormEdit,
,Me.Id


In the second form's Load event:

If Len(Me.OpenArgs & "") > 0 Then _

Forms![frm_PPL]![frm_Control]![frm_BasicData_BasicData].Form![txt_Scenario]
= Me.OpenArgs


--

Ken Snell
<MS ACCESS MVP>

message
I have a form that calls another form with this:
DoCmd.OpenForm "frm_Scenarios_BasicData", acDialog, , , acFormEdit

So when I have frm_Scenario, i need to be able to doble clik on a row
which
value should be sent to the first form.
I have tried this with no result:
Forms![frm_PPL]![frm_Control]![frm_BasicData_BasicData].Form![txt_Scenario]
= Me.Id

Please HELP!!
 
OK then it sounds as if the original problem was that you were using the
wrong names for the subform controls. Glad you got it working.

--

Ken Snell
<MS ACCESS MVP>

Lina Manjarres said:
Hello Ken

I found a workoround.
I moved the txt_Scenario to the frm_BasicData_BasicData form...

Now it works

Thanks a lot!
Lina


Ken Snell (MVP) said:
Sorry, I misunderstood. What I posted doesn't do this.

Your expression that you showed is generally in the right direction. From
it, it appears that you're trying to write the value from the "second"
form
(frm_Scenario_BasicData) to a subform within a subform on the first form
(frm_PPL). Thus, most likely the problem you're having is the correct
names
to use for the subform references. In ACCESS, you must use the name of
the
subform control (the control that holds the subform), which may or may
not
be the same name as the actual source object (the actual form) that is
serving as the subform.

You can check the Name property of the subform controls in the Properties
window. Here is the general syntax to reference a control on a subform in
a
subform in a form:

Forms!NameOfMainForm!NameOfSubformControl!NameOfSubformSubformControl!NameOfControlOnSubformSubform

--

Ken Snell
<MS ACCESS MVP>


message
Thanks a lot for helping me.

I do not know if don't understand, but what I need is to pass a value
from
the second form to the first one.

My first form is frm_BasicData_BasicData, which is opened from frm_PPL
with
an Opensource inside an frm_Control. Then from frm_BasicData_BasicData
i
call
frm_Scenario_BasicData.

From this last form, I want to pass a value to the
frm_BasicData_BasicData
which is in frm_PPL.

Thanks a lot, Lina

:

Pass the value in the OpenArgs argument, and then write it to the
correct
control in the second form:

In the first form:

DoCmd.OpenForm "frm_Scenarios_BasicData", acDialog, , , acFormEdit,
,Me.Id


In the second form's Load event:

If Len(Me.OpenArgs & "") > 0 Then _

Forms![frm_PPL]![frm_Control]![frm_BasicData_BasicData].Form![txt_Scenario]
= Me.OpenArgs


--

Ken Snell
<MS ACCESS MVP>

message
I have a form that calls another form with this:
DoCmd.OpenForm "frm_Scenarios_BasicData", acDialog, , , acFormEdit

So when I have frm_Scenario, i need to be able to doble clik on a
row
which
value should be sent to the first form.
I have tried this with no result:
Forms![frm_PPL]![frm_Control]![frm_BasicData_BasicData].Form![txt_Scenario]
= Me.Id

Please HELP!!
 
Yes, that's right!
Thanks a lot!

Ken Snell (MVP) said:
OK then it sounds as if the original problem was that you were using the
wrong names for the subform controls. Glad you got it working.

--

Ken Snell
<MS ACCESS MVP>

Lina Manjarres said:
Hello Ken

I found a workoround.
I moved the txt_Scenario to the frm_BasicData_BasicData form...

Now it works

Thanks a lot!
Lina


Ken Snell (MVP) said:
Sorry, I misunderstood. What I posted doesn't do this.

Your expression that you showed is generally in the right direction. From
it, it appears that you're trying to write the value from the "second"
form
(frm_Scenario_BasicData) to a subform within a subform on the first form
(frm_PPL). Thus, most likely the problem you're having is the correct
names
to use for the subform references. In ACCESS, you must use the name of
the
subform control (the control that holds the subform), which may or may
not
be the same name as the actual source object (the actual form) that is
serving as the subform.

You can check the Name property of the subform controls in the Properties
window. Here is the general syntax to reference a control on a subform in
a
subform in a form:

Forms!NameOfMainForm!NameOfSubformControl!NameOfSubformSubformControl!NameOfControlOnSubformSubform

--

Ken Snell
<MS ACCESS MVP>


message
Thanks a lot for helping me.

I do not know if don't understand, but what I need is to pass a value
from
the second form to the first one.

My first form is frm_BasicData_BasicData, which is opened from frm_PPL
with
an Opensource inside an frm_Control. Then from frm_BasicData_BasicData
i
call
frm_Scenario_BasicData.

From this last form, I want to pass a value to the
frm_BasicData_BasicData
which is in frm_PPL.

Thanks a lot, Lina

:

Pass the value in the OpenArgs argument, and then write it to the
correct
control in the second form:

In the first form:

DoCmd.OpenForm "frm_Scenarios_BasicData", acDialog, , , acFormEdit,
,Me.Id


In the second form's Load event:

If Len(Me.OpenArgs & "") > 0 Then _

Forms![frm_PPL]![frm_Control]![frm_BasicData_BasicData].Form![txt_Scenario]
= Me.OpenArgs


--

Ken Snell
<MS ACCESS MVP>

message
I have a form that calls another form with this:
DoCmd.OpenForm "frm_Scenarios_BasicData", acDialog, , , acFormEdit

So when I have frm_Scenario, i need to be able to doble clik on a
row
which
value should be sent to the first form.
I have tried this with no result:
Forms![frm_PPL]![frm_Control]![frm_BasicData_BasicData].Form![txt_Scenario]
= Me.Id

Please HELP!!
 
AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 

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

Back
Top