Here is my code:
Private Sub hypUpdateArchitect_Click()
On Error GoTo Err_hypUpdateArchitect_Click
Dim Architect As String
If IsNull(Forms![Bid - Master Form]![cmbArchitect]) Or _
Forms![Bid - Master Form]![cmbArchitect] = "" Then
MsgBox "No architect is selected for update. " & vbCrLf & _
"Please select an architect to update.", vbOKOnly, "No Architect Selected"
Forms![Bid - Master Form]!cmbArchitect.SetFocus
Else
Architect = Forms![Bid - Master Form]![cmbArchitect] 'set architect to current value on master form
DoCmd.OpenForm "Bid - Update Architect"
Forms![Bid - Update Architect]![Architect] = Architect
Forms![Bid - Update Architect].Requery
End If
Exit_hypUpdateArchitect_Click:
Exit Sub
Err_hypUpdateArchitect_Click:
MsgBox Err.Number & vbCrLf & Err.Description
Resume Exit_hypUpdateArchitect_Click
End Sub
When the If statement executes, the focus does not go to forms![Bid - Master Forrm]![cmbArchitect], it simply goes to my database window.
Any idea why?
Scott
Private Sub hypUpdateArchitect_Click()
On Error GoTo Err_hypUpdateArchitect_Click
Dim Architect As String
If IsNull(Forms![Bid - Master Form]![cmbArchitect]) Or _
Forms![Bid - Master Form]![cmbArchitect] = "" Then
MsgBox "No architect is selected for update. " & vbCrLf & _
"Please select an architect to update.", vbOKOnly, "No Architect Selected"
Forms![Bid - Master Form]!cmbArchitect.SetFocus
Else
Architect = Forms![Bid - Master Form]![cmbArchitect] 'set architect to current value on master form
DoCmd.OpenForm "Bid - Update Architect"
Forms![Bid - Update Architect]![Architect] = Architect
Forms![Bid - Update Architect].Requery
End If
Exit_hypUpdateArchitect_Click:
Exit Sub
Err_hypUpdateArchitect_Click:
MsgBox Err.Number & vbCrLf & Err.Description
Resume Exit_hypUpdateArchitect_Click
End Sub
When the If statement executes, the focus does not go to forms![Bid - Master Forrm]![cmbArchitect], it simply goes to my database window.
Any idea why?
Scott