So frustrated... why wont' this copy?

  • Thread starter Thread starter Crispy
  • Start date Start date
C

Crispy

Hi all,

All I want to do is copy a textbox value into one form from another
form. Both forms are open when this occurs.

Here is my code:

Private Sub Form_Close()

If IsNull(Forms!frmNewStudent!ParentID) Then
Forms!frmNewStudent!ParentID = Forms!frmNewParent!ParentsID
Else
End If

End Sub

frmNewParent is the form being closed and copied from
frmNewStudent is the form remaining open and being copied to


This code worked fine used inbetween two other forms...but suddenly,
inbetween these two forms, is only copying the first digit of the value
in the text box over.

Help? Ideas?

Thanks for any help.
 
On what event would I use it on then? It worked on the other form's On
Close event?

Thanks for help
 
Actually, there should have been a question mark at the end of my sentence,
as that's how it was intended. I was merely wondering if that might be the
cause. You might try the Unload event, which fires first as a form is
closing.
 
Well your advise helped. When I moved the code to the AfterUpdate
event... it worked. However, I still find it strange that it wouldn't
work on the OnClose event--- when the same piece of code worked for
another two forms on the OnClose event...
but...

Oh well. Happy I got it working.

Thank you!
 
You loose the pointer to the recordset before you loose the
recordset: it is probably copying the value from the 'first'
record in the recordset, rather than the value from the
record you thought you were using.

(david)
 
What David said AND there may have been some delay in actually destroying
the value held in the pointer to the control on the closing form, so that
you were just being lucky. It may not have actually been working, but looked
like it was.
 

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