I have a form that is used to ID and then load Excel files into Access.
I use labels on the form to record which file was last loaded. That was
accomplished with a simple lblFileLoaded = strFullFileName . The label
would show the file name and when the form was closed and then opened
it would still show the name of the last file loaded. That preserves an
important piece of information.
Suddenly the form has stopped doing that. When you close the form and
reopen it the lbl is blank or has the name from the second prior session.
At someone's suggestion I tried to Save the form on exit. with
"DoCmd.Save acForm, "frmLoad". It gives an error msg of
"the object "frmLoad" is not loaded. The form is loaded and the
following test routine, found on the web, confirms that it is loaded.
Sub test()
Dim IsOpen As Boolean
IsOpen = adhIsFormOpen(" frmLoad")
Debug.Print IsOpen
End Sub
Public Function adhIsFormOpen(s trname As String) As Boolean
On Error Resume Next
Dim FIsOpen As Boolean
FIsOpen = CurrentProject. AllForms(strnam e).IsLoaded
adhIsFormOpen = (Err.Number = 0) And FIsOpen
Err.Clear
End Function
Anyway I really need to have these labels saved on exit
Any ideas?
Thx
Kevin
I use labels on the form to record which file was last loaded. That was
accomplished with a simple lblFileLoaded = strFullFileName . The label
would show the file name and when the form was closed and then opened
it would still show the name of the last file loaded. That preserves an
important piece of information.
Suddenly the form has stopped doing that. When you close the form and
reopen it the lbl is blank or has the name from the second prior session.
At someone's suggestion I tried to Save the form on exit. with
"DoCmd.Save acForm, "frmLoad". It gives an error msg of
"the object "frmLoad" is not loaded. The form is loaded and the
following test routine, found on the web, confirms that it is loaded.
Sub test()
Dim IsOpen As Boolean
IsOpen = adhIsFormOpen(" frmLoad")
Debug.Print IsOpen
End Sub
Public Function adhIsFormOpen(s trname As String) As Boolean
On Error Resume Next
Dim FIsOpen As Boolean
FIsOpen = CurrentProject. AllForms(strnam e).IsLoaded
adhIsFormOpen = (Err.Number = 0) And FIsOpen
Err.Clear
End Function
Anyway I really need to have these labels saved on exit
Any ideas?
Thx
Kevin
Comment