Reset field value

kruger101

Registered User.
Local time
Today, 07:26
Joined
May 9, 2006
Messages
48
Hi all
I've searched the forum but couldn't find anything helpful.
I have a Main Form, with a Sub Form on it. They are linked with the field RefNumber, which is an Autonumber field counting the amount of records.

What I want to happen is: As soon as the RefNumber changes, I want a field on the Subform to reset back to 0. Is this possible? I'm having trouble with the OnChange event for the RefNumber field on the Subform, it's doesn't seem to activate even though the value of RefNumber changes.

Help much appreciated.
Regards and many thanks
kruger101
 
The OnChange event is called when a record value is changed but your question seems more like you want it to reset when you move to another record so that event doesn't get triggered.
Try setting the new value for the subform field in the OnCurrent event in the Main form. This means that each time you move to a new record the value will reset. Are you sure this is what you want?
 
Referring problem

Brian
I'm having problems referring to the value in the subform. Even though I'm using the Expression builder to select the control I want changed, I still get an error saying:
Microsoft Office Access cannot find the form name 'SubFormCalls' referred to in a macro epression or Visual Basic Code.
It's as if I spelt incorrectly, but as I said I used the expression builder.


I tried other resources, such as this example, but I still get the same errorhttp://www.mvps.org/access/forms/frm0031.htm

I did a simple check to see wheter I can change the caption of a textbox on the subform from the Main form, but still nothing happened. I thought I had older versions, but I fully updated Office yesterday.

I'm stumped!!!!!!!!! Please help.
Thanks
 
Oh yeah and I tried your suggestion, but I still get the same error.

Maybe I approach this in the wrong way: If the user goes to the next record, I want an incrementing counter on the subform to reset back to 0, so that I can count from 1 again.
ie. Main Form record = 1
Sub Form: Counter is amount of phone calls. say 3 entries. now counter = 3.

now Main Form record = 2
Sub Form: I want the Counter to reset back to 0, to start counting again.

I hope I explained it correclty.
Thanks
 
SubForm Link

From the Main Form.

Me.FrmSubFormName.Form.FieldName

NB FrmSubFormName is not the name of the form but the name of the subform on the Main Form.
 
Thanks Brian but still the same error.
I have another idea, is it possible to customise the Record Navigation buttons in a Form? I know this is possible in a Data Access Page, but I can't find anything about it on Forms.

Just saw The Record Navigation bar does exactly what I want to do. Now all I have to do is change the wording. Is this possible? From "Records:" to "Calls:"
Cheers
kruger101
 

Users who are viewing this thread

Back
Top Bottom