A
Alan
Hi there,
I'm trying to do something here and think (well I know) it's not working.
Essentially I want some code to execute based on whether there are any
records present on a subform. If there are no records present, code doesn't
run and things continue on normally. If there are records present in the
subform, then execute the code.
Here's the code I wrote:
Private Sub Form_Open(Cancel As Integer)
If Me![sbfmMFGPkgDetails].NewRecord Then
If Me![sbfmMFGPkgDetails]![HSTAT] = "I" Then
Me.Inv.SetFocus
Me.Inv = "Y"
Me.quoteID.SetFocus
Else
If Me![sbfmMFGPkgDetails]![HSTAT] = " " Then
Me.Inv.SetFocus
Me.Inv = "N"
Me.quoteID.SetFocus
Else
End If
End Sub
I'm guessing my problem is related to the top level IF statement..
Any help would be greatly appreciated.
Alan
I'm trying to do something here and think (well I know) it's not working.
Essentially I want some code to execute based on whether there are any
records present on a subform. If there are no records present, code doesn't
run and things continue on normally. If there are records present in the
subform, then execute the code.
Here's the code I wrote:
Private Sub Form_Open(Cancel As Integer)
If Me![sbfmMFGPkgDetails].NewRecord Then
If Me![sbfmMFGPkgDetails]![HSTAT] = "I" Then
Me.Inv.SetFocus
Me.Inv = "Y"
Me.quoteID.SetFocus
Else
If Me![sbfmMFGPkgDetails]![HSTAT] = " " Then
Me.Inv.SetFocus
Me.Inv = "N"
Me.quoteID.SetFocus
Else
End If
End Sub
I'm guessing my problem is related to the top level IF statement..
Any help would be greatly appreciated.
Alan