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

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
 
P

Peter Kaufman

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
 
J

Joan

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
 

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