Passing a value to another form

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

Guest

Hi there.

I have a subform with an ID number on it and when I open another form, I
want to pass to this form the ID number on the previous sub form. When I run
the following code:
me.lngWindID = Forms!frmClients!frmWindow_sub.Form.lngWindID
I get "You can't assign a value to this object"

I have tried an unbound text box on the second form to capture the id
number, which it does, but still will not allow me to assign a value to my
field "lngWindID".

What am I doing wrong? Should I be using the openargs property?

Thanks,

John
 
Hi, Johnny.

Perhaps you were trying to assign the value in the form's OnOpen( ) event?
This will result in the error you mentioned. If this is the case, then
assign the value in the form's OnLoad( ) event. The assignment can be via
OpenArgs or through a value retrieved from an open form.

If not, then this next one is unlikely, but it occasionally happens:
perhaps lngWindID is an AutoNumber field?

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
Back
Top