On Load event not working

  • Thread starter Thread starter Brian S
  • Start date Start date
B

Brian S

Hi,
Using Access 97 on Windows XP, I have a very simple On Load event
procedure not working - neither on the Design Master nor on a replica on
another laptop. I have Office 2003 (inc Access 2003) and Access97 (the one I
use) in separate folder.

Private Sub Form_Load()

'DoCmd.GoToRecord , , acLast
Call update_cbxBlock

Exit_Form_Load:
Exit Sub

Err_Form_load:
MsgBox Err.Description
Resume Exit_Form_Load
End Sub



This did work one or two computers ago - more or less same environment. All
help gratefully received.
 
What does "not working" mean?

Do you get error messages?
Does the wrong thing happen?
Does nothing happen?

Hopefully, you have split the database into a front end (forms, code, reports,
queries, macros) and back end (the data tables). Your back end should be
replicated.

Hopefully, you are not using replication for the front end as that does not
work well and tends to cause problems.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 
Thanks for the reply. "not working " means nothing happens - no error
message. The database is not split - I had been hesitant to try that - never
having done it. The procedure is meant to open form "frmDailyRecords" to the
latest entry - there are about 2,000 records.

Brian S.
 
Are you certain that the code is firing? It's not unheard of for procedures
to get disassociated from the events to which they're supposed to
correspond.

Look at the properties for the form. Does the On Load property contain
[Event Procedure]? If it does, are you taken into the middle of that code in
the VB Editor when you click on the ellipsis (...) to the right of the
property?

"Brian S" wrote in message
Thanks for the reply. "not working " means nothing happens - no error
message. The database is not split - I had been hesitant to try that - never
having done it. The procedure is meant to open form "frmDailyRecords" to the
latest entry - there are about 2,000 records.

Brian S.
 
Yes to both questions. The On Load property does contain
[Event Procedure] and the ellipsis does take you to the code.Wheather the
code actually fires, I don't know how to tell.

Brian S.




Douglas J Steele said:
Are you certain that the code is firing? It's not unheard of for
procedures to get disassociated from the events to which they're supposed
to correspond.

Look at the properties for the form. Does the On Load property contain
[Event Procedure]? If it does, are you taken into the middle of that code
in the VB Editor when you click on the ellipsis (...) to the right of the
property?

"Brian S" wrote in message
Thanks for the reply. "not working " means nothing happens - no error
message. The database is not split - I had been hesitant to try that -
never
having done it. The procedure is meant to open form "frmDailyRecords" to
the
latest entry - there are about 2,000 records.

Brian S.


John Spencer said:
What does "not working" mean?

Do you get error messages?
Does the wrong thing happen?
Does nothing happen?

Hopefully, you have split the database into a front end (forms, code,
reports, queries, macros) and back end (the data tables). Your back end
should be replicated.

Hopefully, you are not using replication for the front end as that does
not work well and tends to cause problems.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 
Brian said:
Yes to both questions. The On Load property does contain
[Event Procedure] and the ellipsis does take you to the code.Wheather the
code actually fires, I don't know how to tell.

Your original code as posted has the first line commented out. Is that
it?
 
Thank you Rick. I had not noticed that - another lesson on why i should
write more notes. Removing the comma gives a run time error so I must have
done this some time ago and forgotten. This is my payroll program and I only
work on it every few years. I may be back to ask for help with that problem
later but for now thans again.


Rick Brandt said:
Brian said:
Yes to both questions. The On Load property does contain
[Event Procedure] and the ellipsis does take you to the code.Wheather the
code actually fires, I don't know how to tell.

Your original code as posted has the first line commented out. Is that
it?
 
Brian S said:
Wheather the code actually fires,
I don't know how to tell.

Put a MsgBox statement in the Event Procedure. If it pops up, then the code
actually fired.

You could do something similar with Debug.Print, but that may be a little
more trouble.

Larry Linson
Microsoft Office Access MVP
 
Access Developer said:
Put a MsgBox statement in the Event Procedure. If it pops up, then the
code actually fired.

You could do something similar with Debug.Print, but that may be a little
more trouble.

Larry Linson
Microsoft Office Access MVP
Thanks Larry L., that's a handy trick.
 
Back
Top