Link to home
Start Free TrialLog in
Avatar of gcgcit
gcgcit

asked on

Calendar Control popping up on Delete

I have a subform with a calendar control.  When I delete a record in the subform the calendar control pops up.  Why would this be happening?  I checked the tab index and it's 9.

ee-calendar.jpg
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Can you show all the code associated with the Delete or upload the db?
Avatar of gcgcit
gcgcit

ASKER

Private Sub cmdDelete_Click()
Dim RemovalWarning As Integer

On Error GoTo Err_cmdDelete_Click
   
RemovalWarning = MsgBox("Are you sure you want to remove this person?", vbYesNo, "Warning!")
   
If RemovalWarning = 7 Then
    Exit Sub
Else
    DoCmd.SetWarnings False
    DoCmd.RunCommand acCmdDeleteRecord
    DoCmd.SetWarnings True
End If

Exit_cmdDelete_Click:
    Exit Sub

Err_cmdDelete_Click:
        MsgBox Err.Number & " - " & Err.Description

    Resume Exit_cmdDelete_Click

End Sub
Well there is certainly nothing in the code you posted that would open the calendar.

1. Let's verify the design:
"I have a subform..."
Then we can assume that this is a true subform that is physically *inside* (embedded in) a main form?
(Not a pop-up subform)

"I have a subform with a calendar control. "
Again, please be specific.  What do you mean by "subform with a calendar control"?
Is it embedded in the subform, or is it a pop-up calendar form?

2. What is the normal sequence of events that should call up the calendar normally?

3. "Why would this be happening?"
You mean this never happened before, and now it suddenly started happening?
(Or are you saying that this always happened.)
...in other words, did this system ever work normally?

4. Will you be posting a sample DB that demonstrates this phenomenon as requested by the first Expert?

JeffCoachman
Avatar of gcgcit

ASKER

Sorry for delay, too a little while to strip down this application to be a small sample.

See attached file, if you remove a person calendar control pops up.
ee-Calendar.mdb
ASKER CERTIFIED SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
sorry MX.

Left this Q open while I did house work...
(Oy!)

Jeff
<Housework ... so THAT'S you are not coming to the summit!>

mx
Avatar of gcgcit

ASKER

I stripped down a database and removed loads of fields, that's why some of the code seems un-used... I just didn't remove it all... but the full system does compile... thanks for the feedback on that though.

Having the pop-up in the After-delete Confirm was the issue - thanks for spotting that... I don't know how that code got in that event - it's not supposed to be there!!!

Who should I give the points to?   DatabaseMX posted first but Boag2000 gave long description also a solution but had forgot to post?  Please advise what both of you will be happy with and I'll close ticket and assign points.
You have to decide on the points ... based on the post that solved the problem.

mx
Just noting the problem was clearly the After Del Confirm event ...

mx
Avatar of gcgcit

ASKER

More points allocated to Database MX because the screenshot made it very easy to find the issue AND he answered first.  

Boag200 did answer but unfortunately it was posted later but helpful information was provided so I gave him partial points.  

Hope you both consider this fair.
I would have had no issue with MX getting the points.
It's first come first serve...

Besides, my post will still be visible in the thread.

Now, ...if the points had a monetary component....
;-)

Jeff
Yeah ... IF $$$$$$ lol.
np on split ...
gcgcit:
You made an intelligent call on the points.
thx.mx