Form event to alert before user moves onto another record

jonesda

Registered User.
Local time
Today, 15:11
Joined
Sep 13, 2005
Messages
36
Hi,

I have a form with some bound fields and some unbound fields. If I make any change to the bound fields I can use the "Before update" event to perform some actions when a user tries to move onto a new record.

What I now need is if a user doesn't make any change to the bound fields but makes a change to an unbound field - how can I check this before the next record is displayed. Is there any event I can use? Each time a user tries to move to a new record I want to check first if they have added anything to an unbound field.

Users can move onto the next record using buttons or the record navigator at the end of the form.

Many Thanks,
 
I believe that you can still use the .old value property of the unbound fields and test if the .value and .oldvalue equal or not for each field. You will have to remove the standard navigation buttons and use your own custom buttons to allow the user the option to move from each record and in the OnClick event for your custom navigation buttons you will be able to test if the .value and .oldvalue equal or not for each field.
 
Was hoping for a nice form method but no luck!

I would like to keep the standard record navigator on the form to let users know how may results have been returned from a query. Is there any way to setup the record naigator to display the total number of records and what record one is currently looking at BUT disable any navigation with it?

Many thanks for your help.
 
Hi ghudson,

I am using Access 2000 and those properties don't seem to be available in this version of access. I have google to see if there is an alternative but can't seem to find any. Do you have any suggestion?

Many Thanks
 
I know the .oldvalue property is available at least since Access 97 for I use it in my Audit Trail sample. Check it out and see how it is used.
 
Hi ghudson,

I am trying to create something similar to what you have with the record count in the RecordXofY example.

But I get :
Run-time error '2455'
You entered an expression that has an invalid reference to the property CurrentRecord.

on the line of code:
Me.lRecordXofY.Caption = "Record " & [CurrentRecord] & " of " & Me.RecordsetClone.RecordCount

I get similar errors when I try: Me.RecordsetClone.RecordCount

I have this code in the form current method. But i don't seem to be able to use any of these properties.

I have added the same references as you have in your RecordXofY example.

Do you have any idea why I might not be able to use these?

If I can dislpay record x of y - I can then remove the record navigator and force the users to use buttons to navigate.

Many Thanks,
 
Me.lRecordXofY.Caption refers to a lable named lRecordXofY. Do you have a label named lRecordXofY in your form? You can copy and paste the objects [text boxes, labels] and the VBA from my sample directly to your db and it will work.
 
Hi again .... still having a problem with this.

I have a form where users enter criteria, which builds a SQL statement and then sets the recordsource of the search results form (a different form) to the sql statement. Search results form then displayed.

In the search results form in the "current" method for the form - I have the code "Me.RecordsetClone.RecordCount" and I get an error: "invalid reference to the RecordSetClone property".

However, if I create a button on the form and but this code behind the button click event - it works fine.

I need to get it working in the form current event though because I want to display Record X of Y. I think it isn't working at the moment because I am setting the recordsource for the form in the initial search form.

Can anyboy offer any ideas / suggestions as to how I might fix / get around this?

Many Thanks
 

Users who are viewing this thread

Back
Top Bottom