Cannot save Form changes with VBA
- From: "KC-Mass" <connearneyATcomcastDOTnet>
- Date: Sat, 31 May 2008 08:45:20 -0400
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(strname As String) As Boolean
On Error Resume Next
Dim FIsOpen As Boolean
FIsOpen = CurrentProject.AllForms(strname).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
.
- Follow-Ups:
- Re: Cannot save Form changes with VBA
- From: lyle fairfield
- Re: Cannot save Form changes with VBA
- Prev by Date: Re: Access and Palm PDA
- Next by Date: Save up to 60% On 3d Modelling, 3d Graphics and 3d Animation Services
- Previous by thread: Access changes my query SQL
- Next by thread: Re: Cannot save Form changes with VBA
- Index(es):
Relevant Pages
|