On Close event

fipp

Registered User.
Local time
Yesterday, 21:39
Joined
Jun 7, 2007
Messages
14
I used the following code in the on close event of my form and it works when the value of [maingameformation.playid] is not previously entered but if there is already a value there it won't overide it? Is this possible to do?


Private Sub Form_Close()
[Forms]![gameentryfrm]![maingameformation.playid] = Me.playid
End Sub
 
its probably because when you enter a value in playid, you now have a partially edited record (a new dirty record)

if you have some test checking for a record validity, the form will not close, because the record is invalid

otherwise, the form may close with a message something like
"record cant be saved"

is this happening?
 
I don't receive any messages, the form just closes and it doesn't update the playid field in the gameentryfrm. I can type in a new value on the gameentryfrm in the playid field and that works.

It just won't over-ride the pre existing value in the playid field in the gameentryfrm on close.

It will enter the value from the playid field into the playid field on the gameentryfrm if there isn't a value already in the playid field on the gameentryfrm.

I would like it to update the value to whatever is in the playid field on the form closing.
 
The on close event occurs AFTER the UNLOAD event so the form doesn't have a recordset to update anymore.
 
It works though. It just won't replace a value if there is already one. If there is no value in that field it will put the value in.
 

Users who are viewing this thread

Back
Top Bottom