Need a bit of help with the final details

psalmon

Registered User.
Local time
Today, 07:22
Joined
Jun 20, 2005
Messages
21
I am almost finished this project. :p There are just a few things left that I would like to do and I need some help.

1. Add an email notification when data on the form has been edited
2. Filter the form for only OPEN orders, status not equal to 6 or 7
3. When an order is closed (status field) I would like to default the "Date Closed" to today, but allow the user to edit the date if need be.
4. Once the status is closed and the date closed is entered, ask the user if they would like to create a followup order.

I have most of #4 done. I added code on the After Update event on the Status field to set the Date Closed to today and then disable the control, then ask if they would like to create the followup order. The users would like to be able to modify the date closed if they don't happen to do the entry until the next day. I have tried adding my code to the After Update of the date (which is updated with a pop up calendar), but once I select the date from the calendar, the focus stays on the date and the user is not prompted to create the followup order.

Any help you can offer would be wonderful

Thanks
Pat
 
For item 1)

Create a report then send it using:

Docmd.sendreport "reportname" --- read up on this one.

For item4)

To move your focus and trigger the code, use the Sendkeys command
to send the "TAB" key to move focus somwhere else.

Hope this helps.
 
Here is my code for #4.

If I run it with the red line commented out it behaves this way:
When the Status is changed to "Closed", the calendar form pops up, I double click on the date, which then populates the txtDateClose control and then the focus stays in that control.

If I un comment the red line it behaves this way:
When the Status is changed to "Closed", the calendar form pops up, I double click on the date, focus moves to the cmdSaveRecord button, but the txtDateClosed control is blank.

Can anyone tell me what I'm doing wrong?
Thanks
Pat

Private Sub cboStatus_AfterUpdate()
Dim NextDueDate As String

If (Me.Status) = "6" Then

Me.txtDateClosed.Enabled = True
Forms!frmMaintainOpenPreventiveMaintenanceOrders!txtDateClosed.SetFocus
DoCmd.OpenForm "frmCalendar", , , , , , Screen.ActiveControl.Value
Forms!frmMaintainOpenPreventiveMaintenanceOrders!cmdSaveRecord.SetFocus

If Not IsNull(txtDateClosed) Then
Forms!frmMaintainOpenPreventiveMaintenanceOrders!cmdSaveRecord.SetFocus
Me.txtDateClosed.Enabled = False
End If

ClosedBy = fOSUserName()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.RunMacro "mcrUpdatePMClosedByField", 2
Me.Refresh


If Not IsNull(txtDateClosed) Then
response = MsgBox("Do You Want to create the next Maintenance Order?", 4, "Create Next Maintenance Order!!!")
If response = vbYes Then
DoCmd.OpenForm "frmCreatePreventiveMaintenanceOrder"

Else: End If
End If


Else
ClosedDate = Null
ClosedBy = Null
Me.Refresh

End If

End Sub
 

Users who are viewing this thread

Back
Top Bottom