Allen Browne Calendar issue

D

deb

I click a date on calendar and it pops up again. I click the data again and
the calendar pops up again. It will accept the date on the 3rd try.

I am using Allen Browne Calendar.
it is on a TAB in a sub-sub-subform
All subforms are linked with parent ID- autonumber
I am calling it by - Call CalendarFor([WSDateDue], "Set Due date"
I have done this in other databases without issues, but this time I am
getting the calendar pop up 3 times.

I noticed this happens when I add a new master record. It works fine if I
edit or click into a field in the sub-sub-subform.
Why is this happening?
I am desperate for help!!
 
A

Allen Browne

Presumably we are talking about this pop-up calendar:
http://allenbrowne.com/ser-51.html

It only works with valid dates. Perhaps there is a problem with a non-date
value in your text box. This could occur if the control has an invalid
Default Value, or if you programmatically assign a non-date value to an
unbound control such as:
Me.WSDueDate = ""
where the code should have been:
Me.WSDueDate = Null
 
D

deb

Thank you Allen for your response,
Love the pop up calendar!!

I am using Short date, and do not set the default.

Here's my story..

All IDs are autonumber.
I have a main form that holds project data (fProject)
a subform that holds deliverable date (fDeliv)
a sub-subform that holds transmittal data (fTLNo) This data is entered by
code..

Private Sub Form_AfterInsert()
'Creates the record in the tTLNo table
If Me.Dirty Then Me.Dirty = False
Dim db As DAO.Database
Dim strSql As String
strSql = "INSERT INTO tTLNo (DelivID) " & _
"SELECT " & Me.DelivID & " AS Expr1;"
Set db = DBEngine(0)(0)
db.Execute strSql, dbFailOnError
Set db = Nothing

I also have a sub-sub-Subforms (fWS) (fCS) (fSC) that holds 3 tabs that
enter the dates for the transmittals.

The reason I have the TLNo form ID created by code is, the TL data is not
entered until the transmittals are sent to the customer. Therefore I will
have dates in the sub-sub-Subforms (fWS) (fCS) (fSC) before I have the TLNo
for the form tTLNo.
So I must create a record in fTLNo to link to the last 3 forms.

See below for the code in one of the fWS form...
Option Compare Database

Private Sub btnWSDateReq_Click()
Call CalendarFor([WSDateRequested], "Set Requested date")
End Sub

Private Sub btnWSDateDue_Click()
Call CalendarFor([WSDateDue], "Set Due date")
End Sub

Private Sub btnWSDateEstRec_Click()
Call CalendarFor([WSDateEstReceive], "Set Estimated Date to Receive")
End Sub

Private Sub btnWSDateRec_Click()
If IsNull(Me.Parent.TLNo) Then
MsgBox "Please Enter TL Number"
Me.Parent.TLNo.SetFocus
Cancel = True
Else
Call CalendarFor([WSDateReceive], "Set Received date")
End If
End Sub


Private Sub Form_BeforeUpdate(Cancel As Integer)
Me.TLNoID.Requery
If Me.WSDateRequested > Me.WSDateDue Then
Cancel = True
MsgBox "Requested date must be prior to Due date."
End If

If IsNull(Me.WSDateReceive) And Not IsNull(Me.Parent.TLNo) Then
MsgBox "Please enter Received Date"
WSDateReceive.SetFocus
Cancel = True
End If

If IsNull(Me.Parent.Parent.DelivTitle) Then
MsgBox "Must enter title for Deliverable before entering dates."
Me.Undo
Me.Parent.Parent.DelivTitle.SetFocus
End If
End Sub

Private Sub Form_Current()
' Enable/Disable Navigation Buttons as required
Call Me.WSfrmNavButtons.Form.EnableDisableButtons

If IsNull(Me.WSDateReceive) And Not IsNull(Me.Parent.TLNo) Then
MsgBox "Please enter Received Date"
WSDateReceive.SetFocus
Cancel = True
End If
End Sub

Private Sub btnDelWS_Click()
On Error GoTo Err_btnDelWS_Click

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Exit_btnDelWS_Click:
Exit Sub

Err_btnDelWS_Click:
MsgBox Err.Description
Resume Exit_btnDelWS_Click

End Sub


Private Sub WSResponsible_Exit(Cancel As Integer)
Me.[WSResponsible].Requery
End Sub

Private Sub WSResponsibleDept_Exit(Cancel As Integer)
Me.[WSResponsibleDept].Requery
End Sub

I noticed that it only pops up multiple times if it is a new Deliverable.
It works fine if I enter a date into an existing record or change a date.

PLEASE!!! Help


--
deb


Allen Browne said:
Presumably we are talking about this pop-up calendar:
http://allenbrowne.com/ser-51.html

It only works with valid dates. Perhaps there is a problem with a non-date
value in your text box. This could occur if the control has an invalid
Default Value, or if you programmatically assign a non-date value to an
unbound control such as:
Me.WSDueDate = ""
where the code should have been:
Me.WSDueDate = Null

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

deb said:
I click a date on calendar and it pops up again. I click the data again
and
the calendar pops up again. It will accept the date on the 3rd try.

I am using Allen Browne Calendar.
it is on a TAB in a sub-sub-subform
All subforms are linked with parent ID- autonumber
I am calling it by - Call CalendarFor([WSDateDue], "Set Due date"
I have done this in other databases without issues, but this time I am
getting the calendar pop up 3 times.

I noticed this happens when I add a new master record. It works fine if I
edit or click into a field in the sub-sub-subform.
Why is this happening?
I am desperate for help!!
 
A

Allen Browne

Deb, the problem you describe seems to be related to the events that fire
connected with your code, and not to the calendar.

You will need to do some debugging to see which events fire when, why, and
how many times. Add some code to the relevant events, such as:
Debug.Print "Form_Sub1.Current fired at " & Now() & " for ID " & Me.ID

You may need to Requery some forms so that the newly inserted data shows up.
Be careful though: you don't want to create an endless loop. For example, if
you requery a parent form, that causes the subform to reload, and if that
requeries the parent form again you are in trouble.

There are some known issues with these events. For example, if you tab out
of a main form into a subform, and the main form's AfterUpdate event
requeries the subform, the subform control's Enter event doesn't fire.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

deb said:
Thank you Allen for your response,
Love the pop up calendar!!

I am using Short date, and do not set the default.

Here's my story..

All IDs are autonumber.
I have a main form that holds project data (fProject)
a subform that holds deliverable date (fDeliv)
a sub-subform that holds transmittal data (fTLNo) This data is entered by
code..

Private Sub Form_AfterInsert()
'Creates the record in the tTLNo table
If Me.Dirty Then Me.Dirty = False
Dim db As DAO.Database
Dim strSql As String
strSql = "INSERT INTO tTLNo (DelivID) " & _
"SELECT " & Me.DelivID & " AS Expr1;"
Set db = DBEngine(0)(0)
db.Execute strSql, dbFailOnError
Set db = Nothing

I also have a sub-sub-Subforms (fWS) (fCS) (fSC) that holds 3 tabs that
enter the dates for the transmittals.

The reason I have the TLNo form ID created by code is, the TL data is not
entered until the transmittals are sent to the customer. Therefore I will
have dates in the sub-sub-Subforms (fWS) (fCS) (fSC) before I have the
TLNo
for the form tTLNo.
So I must create a record in fTLNo to link to the last 3 forms.

See below for the code in one of the fWS form...
Option Compare Database

Private Sub btnWSDateReq_Click()
Call CalendarFor([WSDateRequested], "Set Requested date")
End Sub

Private Sub btnWSDateDue_Click()
Call CalendarFor([WSDateDue], "Set Due date")
End Sub

Private Sub btnWSDateEstRec_Click()
Call CalendarFor([WSDateEstReceive], "Set Estimated Date to Receive")
End Sub

Private Sub btnWSDateRec_Click()
If IsNull(Me.Parent.TLNo) Then
MsgBox "Please Enter TL Number"
Me.Parent.TLNo.SetFocus
Cancel = True
Else
Call CalendarFor([WSDateReceive], "Set Received date")
End If
End Sub


Private Sub Form_BeforeUpdate(Cancel As Integer)
Me.TLNoID.Requery
If Me.WSDateRequested > Me.WSDateDue Then
Cancel = True
MsgBox "Requested date must be prior to Due date."
End If

If IsNull(Me.WSDateReceive) And Not IsNull(Me.Parent.TLNo) Then
MsgBox "Please enter Received Date"
WSDateReceive.SetFocus
Cancel = True
End If

If IsNull(Me.Parent.Parent.DelivTitle) Then
MsgBox "Must enter title for Deliverable before entering dates."
Me.Undo
Me.Parent.Parent.DelivTitle.SetFocus
End If
End Sub

Private Sub Form_Current()
' Enable/Disable Navigation Buttons as required
Call Me.WSfrmNavButtons.Form.EnableDisableButtons

If IsNull(Me.WSDateReceive) And Not IsNull(Me.Parent.TLNo) Then
MsgBox "Please enter Received Date"
WSDateReceive.SetFocus
Cancel = True
End If
End Sub

Private Sub btnDelWS_Click()
On Error GoTo Err_btnDelWS_Click

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Exit_btnDelWS_Click:
Exit Sub

Err_btnDelWS_Click:
MsgBox Err.Description
Resume Exit_btnDelWS_Click

End Sub


Private Sub WSResponsible_Exit(Cancel As Integer)
Me.[WSResponsible].Requery
End Sub

Private Sub WSResponsibleDept_Exit(Cancel As Integer)
Me.[WSResponsibleDept].Requery
End Sub

I noticed that it only pops up multiple times if it is a new Deliverable.
It works fine if I enter a date into an existing record or change a date.

PLEASE!!! Help


--
deb


Allen Browne said:
Presumably we are talking about this pop-up calendar:
http://allenbrowne.com/ser-51.html

It only works with valid dates. Perhaps there is a problem with a
non-date
value in your text box. This could occur if the control has an invalid
Default Value, or if you programmatically assign a non-date value to an
unbound control such as:
Me.WSDueDate = ""
where the code should have been:
Me.WSDueDate = Null

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

deb said:
I click a date on calendar and it pops up again. I click the data again
and
the calendar pops up again. It will accept the date on the 3rd try.

I am using Allen Browne Calendar.
it is on a TAB in a sub-sub-subform
All subforms are linked with parent ID- autonumber
I am calling it by - Call CalendarFor([WSDateDue], "Set Due date"
I have done this in other databases without issues, but this time I am
getting the calendar pop up 3 times.

I noticed this happens when I add a new master record. It works fine if
I
edit or click into a field in the sub-sub-subform.
Why is this happening?
I am desperate for help!!
 
D

deb

Thank you, I appreciate your help.
I will keep trying to find where the issue is. It's just driving me crazy
so far.

May use a button to open the form with the tabs to force the IDs to create.
Thats about all I can think of so far
--
deb


Allen Browne said:
Deb, the problem you describe seems to be related to the events that fire
connected with your code, and not to the calendar.

You will need to do some debugging to see which events fire when, why, and
how many times. Add some code to the relevant events, such as:
Debug.Print "Form_Sub1.Current fired at " & Now() & " for ID " & Me.ID

You may need to Requery some forms so that the newly inserted data shows up.
Be careful though: you don't want to create an endless loop. For example, if
you requery a parent form, that causes the subform to reload, and if that
requeries the parent form again you are in trouble.

There are some known issues with these events. For example, if you tab out
of a main form into a subform, and the main form's AfterUpdate event
requeries the subform, the subform control's Enter event doesn't fire.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

deb said:
Thank you Allen for your response,
Love the pop up calendar!!

I am using Short date, and do not set the default.

Here's my story..

All IDs are autonumber.
I have a main form that holds project data (fProject)
a subform that holds deliverable date (fDeliv)
a sub-subform that holds transmittal data (fTLNo) This data is entered by
code..

Private Sub Form_AfterInsert()
'Creates the record in the tTLNo table
If Me.Dirty Then Me.Dirty = False
Dim db As DAO.Database
Dim strSql As String
strSql = "INSERT INTO tTLNo (DelivID) " & _
"SELECT " & Me.DelivID & " AS Expr1;"
Set db = DBEngine(0)(0)
db.Execute strSql, dbFailOnError
Set db = Nothing

I also have a sub-sub-Subforms (fWS) (fCS) (fSC) that holds 3 tabs that
enter the dates for the transmittals.

The reason I have the TLNo form ID created by code is, the TL data is not
entered until the transmittals are sent to the customer. Therefore I will
have dates in the sub-sub-Subforms (fWS) (fCS) (fSC) before I have the
TLNo
for the form tTLNo.
So I must create a record in fTLNo to link to the last 3 forms.

See below for the code in one of the fWS form...
Option Compare Database

Private Sub btnWSDateReq_Click()
Call CalendarFor([WSDateRequested], "Set Requested date")
End Sub

Private Sub btnWSDateDue_Click()
Call CalendarFor([WSDateDue], "Set Due date")
End Sub

Private Sub btnWSDateEstRec_Click()
Call CalendarFor([WSDateEstReceive], "Set Estimated Date to Receive")
End Sub

Private Sub btnWSDateRec_Click()
If IsNull(Me.Parent.TLNo) Then
MsgBox "Please Enter TL Number"
Me.Parent.TLNo.SetFocus
Cancel = True
Else
Call CalendarFor([WSDateReceive], "Set Received date")
End If
End Sub


Private Sub Form_BeforeUpdate(Cancel As Integer)
Me.TLNoID.Requery
If Me.WSDateRequested > Me.WSDateDue Then
Cancel = True
MsgBox "Requested date must be prior to Due date."
End If

If IsNull(Me.WSDateReceive) And Not IsNull(Me.Parent.TLNo) Then
MsgBox "Please enter Received Date"
WSDateReceive.SetFocus
Cancel = True
End If

If IsNull(Me.Parent.Parent.DelivTitle) Then
MsgBox "Must enter title for Deliverable before entering dates."
Me.Undo
Me.Parent.Parent.DelivTitle.SetFocus
End If
End Sub

Private Sub Form_Current()
' Enable/Disable Navigation Buttons as required
Call Me.WSfrmNavButtons.Form.EnableDisableButtons

If IsNull(Me.WSDateReceive) And Not IsNull(Me.Parent.TLNo) Then
MsgBox "Please enter Received Date"
WSDateReceive.SetFocus
Cancel = True
End If
End Sub

Private Sub btnDelWS_Click()
On Error GoTo Err_btnDelWS_Click

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Exit_btnDelWS_Click:
Exit Sub

Err_btnDelWS_Click:
MsgBox Err.Description
Resume Exit_btnDelWS_Click

End Sub


Private Sub WSResponsible_Exit(Cancel As Integer)
Me.[WSResponsible].Requery
End Sub

Private Sub WSResponsibleDept_Exit(Cancel As Integer)
Me.[WSResponsibleDept].Requery
End Sub

I noticed that it only pops up multiple times if it is a new Deliverable.
It works fine if I enter a date into an existing record or change a date.

PLEASE!!! Help


--
deb


Allen Browne said:
Presumably we are talking about this pop-up calendar:
http://allenbrowne.com/ser-51.html

It only works with valid dates. Perhaps there is a problem with a
non-date
value in your text box. This could occur if the control has an invalid
Default Value, or if you programmatically assign a non-date value to an
unbound control such as:
Me.WSDueDate = ""
where the code should have been:
Me.WSDueDate = Null

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

I click a date on calendar and it pops up again. I click the data again
and
the calendar pops up again. It will accept the date on the 3rd try.

I am using Allen Browne Calendar.
it is on a TAB in a sub-sub-subform
All subforms are linked with parent ID- autonumber
I am calling it by - Call CalendarFor([WSDateDue], "Set Due date"
I have done this in other databases without issues, but this time I am
getting the calendar pop up 3 times.

I noticed this happens when I add a new master record. It works fine if
I
edit or click into a field in the sub-sub-subform.
Why is this happening?
I am desperate for help!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top