@MajP The not dialoge version works just fine.Standard method in library to open any form
See both the dialog and non dialog versions.
Code:Public Function openForm(formName, Optional view As AcFormView = acNormal, Optional filterName, Optional whereCOndition, Optional datamode As AcFormOpenDataMode = acFormPropertySettings, Optional windowMode As AcWindowMode = acWindowNormal, Optional openArgs) As Access.Form DoCmd.openForm formName, view, filterName, whereCOndition, datamode, windowMode, openArgs Set openForm = Forms(formName) End Function
Non dialog version
Code:Public WithEvents FrmMonthYear As Access.Form '**************************************************************************************************************************************************************** '----------------------------------------------------------------------------------- No Dialog ------------------------------------------------------------- '***************************************************************************************************************************************************************** Private Sub cmdLibraryNoDialog_Click() Set FrmMonthYear = calendarlibrary.OpenForm("MonthYearPicker_NoDialog") FrmMonthYear.OnClose = "[Event Procedure]" End Sub Private Sub FrmMonthYear_Close() 'Allows for OK / Cancel. Put a property in the class if the OK button was selected If FrmMonthYear.ok_Selected Then 'custom property Me.txtMonth = FrmMonthYear.txtYearMonth Me.txtYear = FrmMonthYear.txtYearMonth End If End Sub
I added a property in the form to check if OK was selected.[/ICODE]
Simple and very easy to re-use.
Seems that I was over-complicated my situation.
Million thanks for your help.