Class variable resets when adding new record in subform (1 Viewer)

joeKra

Registered User.
Local time
Today, 03:07
Joined
Jan 24, 2012
Messages
208
Hi Guys

I am having a strange behavior.
I have a parent form which has a class variable (class module instance) to store the form' status and more.... and when i add a new record to the subform it resets the class variable field' data. but this only happens on first transaction, but if i re-run the steps (re-set the variable field value) it's not happening again. what could it be ?? an access bug ??

Thanks in Advance
 

joeKra

Registered User.
Local time
Today, 03:07
Joined
Jan 24, 2012
Messages
208
EDIT: i see now that all the variables are having the same issue, not only class instance (i started using Raise event lately. in code. might be the cause ?)
 

spikepl

Eledittingent Beliped
Local time
Today, 09:07
Joined
Nov 3, 2010
Messages
6,142
You are like asking for comments on a painting without anyone seeing the painting. Provide some specifics to look at like code.
 

joeKra

Registered User.
Local time
Today, 03:07
Joined
Jan 24, 2012
Messages
208
where should is start ??
Basically, i have form "contract" with subform "Payments"
form "Contract" sets a variable to an instance of the Class module "clsContract" and accompanying properties......
when user hits "New" on contract form it sets clsContract.RecordStatus ="New Contract"
when user hits "Edit" on contract form it sets clsContract.RecordStatus ="Edit Contract" when hitting "Save" it needs to determine the type of record based on the RecordStatus (there's multiple statuses. not quantified here)
just another fact. The "Contract" form has a custom event which other subform's are listening to (besides the "payment" sub form)
so what i am seeing is that all variable's are being reset when adding a new record to the payment SubForm, but ONLY when main form first loaded (meaning - will happen by first transaction of the day only)
i already tried to Decompile\Compile; Recreate payment form. so far no luck
 

Users who are viewing this thread

Top Bottom