setfocus

bry

Registered User.
Local time
Today, 21:21
Joined
Oct 8, 2001
Messages
10
Hi all,

Can anybody help me!

I have a main form called "network data form_2" with 2 subforms called, "Material subform" & "Pipe diameter subform".
What i whant to do is for a control called "network info source" (which is on the main form) to get the focus when a
field in "material subform" is Null.

This is what i have got at the moment and i keep getting errors.


Private Sub Pipe_Material_LostFocus()
If IsNull(Me.[pipe material description]) Then
'Me.Detail.[network info source].SetFocus
Form.[Network data form_2].[network info source].SetFocus
End If
Me.Parent.[Pipe diameter Subform].SetFocus
End Sub


Thanks bry.
 
Try this:

Private Sub Pipe_Material_LostFocus()

If IsNull(Me![Material Subform].Form![pipe material description]) Then
Me![network info source].SetFocus
End If

End Sub
 
No, that doesent work either ott.

I've tried many variations but seem to keep getting this message:-

Run-time error '438'
Object doesnt support this property or method

Thanks,

bry
 
Got IT! - Thanks for looking at it everyone.
I had to create a macro to do what i wanted, the converted it to VB, then i just pasted the code and BINGO!

Thanks,
bry - here is the code

Private Sub Pipe_Material_LostFocus()
If IsNull(Me.[pipe material description]) Then

DoCmd.OpenForm "Network data form_2", acNormal, "", "", , acNormal
DoCmd.GoToControl "network info source"


Else: Me.Parent.[Pipe diameter Subform].SetFocus
End If
 

Users who are viewing this thread

Back
Top Bottom