Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calendar Set and Close

Status
Not open for further replies.

jdd3110

MIS
Dec 11, 2003
18
US
This should be easy...I have a calendar form to input a date into a particular field on a form. I want the form to automatically close when a date is clicked, but the way it is now, my entire main form closes rather than the calendar. Here is a portion on my code for the calendar. Any suggestions would be appreciated. Thanks...Josh

Code:
Private Sub SetAndClose()

    If mctlDate Is Nothing Then
    
        MsgBox "The DateControl property has not been set", , "Calendar Form Error"
    
    Else
        mctlDate = ctlCalendar.Value
    End If
    
    DoCmd.close
 
Try telling it what to close.
docmd.close acForm, "TheFormYouWantToClose"

HTH,
Eric
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top