Which event 'triggers' when I use the navigation buttons ? (1 Viewer)

liamfitz

Registered User.
Local time
Today, 13:07
Joined
May 17, 2012
Messages
240
I have a subform, which I know loads the desired recordset ( passing it a variable/field value from the mainform's recordset ) using a label's 'On Click' event, to test it's loading the correct related subset of data. I'd like this to be triggered automatically, by an event which occurs when I navigate back and forth through the mainform's recordset ( I take it there is at least one, although I've tried several of the most likely i.e On Change, On Data Change, AfterUpdate etc. ) It was suggested 'Current' would work but it returns 'No Current Record' on initially loading the form. Please can someone help. I'd be most grateful. Thanks. :confused:
 

VilaRestal

';drop database master;--
Local time
Today, 13:07
Joined
Jun 8, 2011
Messages
1,046
It is on Current.

You could probably get round the error with some error handling. On Error Resume Next may be ok, otherwise the standard

Private Sub Form_Current()
On Error Goto Form_Current_Exit

'Your code here

Form_Current_Exit:
End Sub
 

liamfitz

Registered User.
Local time
Today, 13:07
Joined
May 17, 2012
Messages
240
Thanks. I'll give it a go.
 

liamfitz

Registered User.
Local time
Today, 13:07
Joined
May 17, 2012
Messages
240
That works perfectly. ( It bypasses the initial On Load issue for the first record which is correct anyway in subform ) Very many thanks Sir.
 

Users who are viewing this thread

Top Bottom