I have a form caller "Project Main" and a subform called "Product Manager Main". The after update event code below finds the value of several controls on both forms to later send it by e-mail. However that also changes the focus.
The last bit of code is in there to return the focus to the control in the subform it started with, however it is not happening. The focus is staying with the last control checked in the project main form (SKU#)
Does anyone know why?
Thanks
mafhobb
The last bit of code is in there to return the focus to the control in the subform it started with, however it is not happening. The focus is staying with the last control checked in the project main form (SKU#)
Does anyone know why?
Code:
Private Sub ReleaseDate_AfterUpdate()
On Error GoTo err_afterupdate
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim strSql As String
Dim strEmailAddress As String
Dim mail
Dim NewReleaseDate As Variant
Dim MSMDate As Variant
Dim SKU
Dim TestInput As Variant
Dim RDName As Variant
Dim ProjectName As Variant
Dim email As String
Dim RDID As String
Dim PMcommentby As Variant
'find what the new release date is
Me.ReleaseDate.SetFocus
NewReleaseDate = Me.ReleaseDate.Text
'find the MSM date
[Forms]![Project Main]![Marketing Specialist Main]![MSM Date].SetFocus
MSMDate = [Forms]![Project Main]![Marketing Specialist Main]![MSM Date].Text
'If MSN has not been done then end
If MSMDate = "" Then
MsgBox "MSM Not Held. No e-mail forwarded to MSM group"
Exit Sub
End If
'Find the Project Name this e-mail refers to
[Forms]![Project Main]![Project Name].SetFocus
ProjectName = [Forms]![Project Main]![Project Name].Text
'MsgBox ProjectName
'Find the R&D ID# for this project
[Forms]![Project Main]![R&D ID#].SetFocus
RDID = [Forms]![Project Main]![R&D ID#].Text
'MsgBox [R&D ID#]
'Find the SKU# for this project
[Forms]![Project Main]![SKU#].SetFocus
SKU = [Forms]![Project Main]![SKU#].Text
'MsgBox SKU
'Move focus back to the subform
[Forms]![Project Main]![Product Manager Main]![ReleaseDate].SetFocus
Thanks
mafhobb