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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Close Form from Calendar Control on Form 2

Status
Not open for further replies.

netrusher

Technical User
Feb 13, 2005
952
US
I had an earlier posting and kind of added close form to the other posting but am making it its own post now.

I have a Calendar Control on a form DateFrm see code below: I cannot close the DateFrm
from the CalEnd_Exit. Any advice on how to accomplish this? After the code from the Calendar Function
is triggered I want the Form DateFrm that the Calendar Control is on to close.

Code:
Private Sub CalEnd_Exit(Cancel As Integer)

    Dim stDocName As String

    stDocName = "BucketTblReqdPartsQty"
    DoCmd.OpenQuery stDocName, acNormal, acEdit


    DoCmd.Close acForm, "DateFrm"

End Sub
 
The form never closes and I can find nothing stoping the
code from running. It just blows up and stops on
Code:
DoCmd.Close acForm, "DateFrm"
. Any other
suggestions?
 
No error message ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I have been researching this error but can't figure anything
out unless it is because I am calling a query.

Run-time error 2585

This action can't be carried out while processing a form or
report event.
 
Doesn't BucketTblReqdPartsQty need the form open ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV,

Well the query is actually running and then I am trying to
close the form after the query runs. It only needs form
until the query runs. Maybe I am closing the form at the
wrong time. Basically I want to:
Select the dates, run the query and close the form. I am
really open to suggestions as to when etc. I have been
working on this for two days. I am hoping this can be
solved and desperately looking for your input or
suggestions.
Thanks
 
By the way, the query that is running is a make table query
 
I do not know what I did differently but this code is
working below?? This kind of thing drives me nuts!!!

Code:
Private Sub CalEnd_Click()

    EndDateTxt.Value = CalEnd.Value
    EndDateTxt.SetFocus
    CalEnd.Visible = False
    
    Dim stDocName As String

    stDocName = "BucketTblReqdPartsQty"
    DoCmd.OpenQuery stDocName, acNormal, acEdit
    
DoCmd.Close acForm, "DateFrm"

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top