Cannot save Form changes with VBA



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


.



Relevant Pages

  • Re: Cannot save Form changes with VBA
    ... If the form and textbox are bound to a field in a table then the ... Private Sub Form_Load ... I use labels on the form to record which file was last loaded. ... Public Function adhIsFormOpenAs Boolean ...
    (comp.databases.ms-access)
  • Re: Arraylist Index Question
    ... >> dim b as boolean ... >> where 'labels' is an array of labels. ... Armin ...
    (microsoft.public.dotnet.languages.vb)
  • Re: join with no related field
    ... they can hand shoose the rows to be used in for the labels. ... when all they wanted to do is import i added a boolean yes/no field to ... label app's data and not change the external data. ...
    (microsoft.public.access.queries)
  • Re: Paint event confusion, please help!!!
    ... Inside each panel is a series of labels and when a user clicks any ... Private Sub SelectRow(ByVal iRow As Integer, ... end Sub public property IsSelected as boolean get return mSelected end get setmSelected=value end set ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Arraylist Index Question
    ... "Armin Zingler" schrieb ... dim b as boolean ... where 'labels' is an array of labels. ...
    (microsoft.public.dotnet.languages.vb)