Focus problems

kermit5

Registered User.
Local time
Today, 14:32
Joined
Nov 2, 2001
Messages
122
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
 
From where's that code running?
Is it from the form "Bid - Master Form" or not?

If not, you may have to select the form first with
Forms![Bid - Master Form].Setfocus
 

Users who are viewing this thread

Back
Top Bottom