Setting value of a record's field in different record source

  • Thread starter Thread starter Joan
  • Start date Start date
J

Joan

I would like to set the value of a record's field that is in a different
record source than that of the form I'd like to do it from. So I was going
to put code behind a click event of the current form that would set a field
in a different form to an empty string, "". The form with the click event
is called CreditMemo. The different form is called SalesScreen and the
field that I want to set to an empty string is [Store]. How do I write code
to do this for the click event of the first form? SalesScreen is not open.

Joan
 
You can't set the value of a control on a form that is not open!

Would opening SalesScreen but making it invisible work for you? If so
you access the control from the other form with the syntax
forms("Salesscreen")("store"). You then make it visible at the
appropriate time and don't forget to close it later

Peter
 
Thanks Peter. I got the result I wanted by running an update query.

Joan


Peter Kaufman said:
You can't set the value of a control on a form that is not open!

Would opening SalesScreen but making it invisible work for you? If so
you access the control from the other form with the syntax
forms("Salesscreen")("store"). You then make it visible at the
appropriate time and don't forget to close it later

Peter


I would like to set the value of a record's field that is in a different
record source than that of the form I'd like to do it from. So I was going
to put code behind a click event of the current form that would set a field
in a different form to an empty string, "". The form with the click event
is called CreditMemo. The different form is called SalesScreen and the
field that I want to set to an empty string is [Store]. How do I write code
to do this for the click event of the first form? SalesScreen is not open.

Joan
 
Back
Top