I have the following On Click data in my frmStartup (my main menu). I get a VBA error message that "compile error: method or data member not found". The line is grayed out where it says Me.frmStartup on the close line mid way down. Here is Part 1 of 2.
--------------------------------------
Private Sub cmdStartUp_Click()
On Error GoTo Err_cmdStartUp_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmMain"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.CLOSE acForm, Me.frmStartUp
Exit_cmdStartUp_Click:
Exit Sub
Err_cmdStartUp_Click:
MsgBox Err.Description
Resume Exit_cmdStartUp_Click
End Sub
---------------------------
So i cannot close frmStartup and open up frmMain.
Here is Part 2 of 2.
I next have a Close button on frmMain in the On Click which seems to work. I only note it for informational reasons.
----------------------------------------
Private Sub cmdClose_Click()
On Error GoTo Err_cmdClose_Click
If Me.Dirty Then
Me.Dirty = False
End If
DoCmd.CLOSE
Exit_cmdClose_Click:
Exit Sub
Err_cmdClose_Click:
MsgBox Err.Description
Resume Exit_cmdClose_Click
DoCmd.Maximize
DoCmd.OpenForm "frmStartup"
End Sub
-------------------------------------
I learned about the me.dirty today from a book by Phil Mitchell. He refers to an undocumented Access error which a friend of mine encountered. He lost 100 records because of a simplistic close button and also clicking on open forms without getting off his current form and allowing it to save.
So Mitchell suggests the Dirty method above. So this is why i am cleaning up my close buttons.
But I need part 1 to get fixed when i want to close the frmStartup.
thanks alot.
Molly
--------------------------------------
Private Sub cmdStartUp_Click()
On Error GoTo Err_cmdStartUp_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmMain"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.CLOSE acForm, Me.frmStartUp
Exit_cmdStartUp_Click:
Exit Sub
Err_cmdStartUp_Click:
MsgBox Err.Description
Resume Exit_cmdStartUp_Click
End Sub
---------------------------
So i cannot close frmStartup and open up frmMain.
Here is Part 2 of 2.
I next have a Close button on frmMain in the On Click which seems to work. I only note it for informational reasons.
----------------------------------------
Private Sub cmdClose_Click()
On Error GoTo Err_cmdClose_Click
If Me.Dirty Then
Me.Dirty = False
End If
DoCmd.CLOSE
Exit_cmdClose_Click:
Exit Sub
Err_cmdClose_Click:
MsgBox Err.Description
Resume Exit_cmdClose_Click
DoCmd.Maximize
DoCmd.OpenForm "frmStartup"
End Sub
-------------------------------------
I learned about the me.dirty today from a book by Phil Mitchell. He refers to an undocumented Access error which a friend of mine encountered. He lost 100 records because of a simplistic close button and also clicking on open forms without getting off his current form and allowing it to save.
So Mitchell suggests the Dirty method above. So this is why i am cleaning up my close buttons.
But I need part 1 to get fixed when i want to close the frmStartup.
thanks alot.
Molly