From: Bre-x on
I have a main form and a subform

Whe the subform is not showing any record I want to stop my code on the
main form


Private Sub Form_Current()
'Setup variables
var_folder = const_path & Me.fsearchsub!pmac & "\" & Me.fsearchsub!tcustid
var_path = var_folder & "\" & Me.fsearchsub!pmac & Me.fsearchsub!pprog
var_fn = "FN-" & Me.fsearchsub!tcustid & "/" & Me.fsearchsub!pmac &
Me.fsearchsub!pprog
var_prog = Me.fsearchsub!pprog
var_mac = Me.fsearchsub!pmac
End Sub


From: John W. Vinson on
On Thu, 11 Feb 2010 10:52:46 -0700, "Bre-x" <cholotron(a)hotmail.com> wrote:

>I have a main form and a subform
>
>Whe the subform is not showing any record I want to stop my code on the
>main form
>
>
>Private Sub Form_Current()
>'Setup variables
>var_folder = const_path & Me.fsearchsub!pmac & "\" & Me.fsearchsub!tcustid
>var_path = var_folder & "\" & Me.fsearchsub!pmac & Me.fsearchsub!pprog
>var_fn = "FN-" & Me.fsearchsub!tcustid & "/" & Me.fsearchsub!pmac &
>Me.fsearchsub!pprog
>var_prog = Me.fsearchsub!pprog
>var_mac = Me.fsearchsub!pmac
>End Sub
>

ummm...

You're setting some variables. You're not doing anything with them, and not
telling us enough information that we could offer any advice on what to do
with them.

What's the Recordsource of the subform? What determines whether or not it has
records? What is its Master Link Field and Child Link Field?
--

John W. Vinson [MVP]
From: Bre-x on
Thank you for answering my question.

I move the code to the sub form, and that did the trick

Thank You!!!!!








"John W. Vinson" <jvinson(a)STOP_SPAM.WysardOfInfo.com> wrote in message
news:aik8n55njnifij5a24o6q40tr9vlkaid1h(a)4ax.com...
> On Thu, 11 Feb 2010 10:52:46 -0700, "Bre-x" <cholotron(a)hotmail.com> wrote:
>
>>I have a main form and a subform
>>
>>Whe the subform is not showing any record I want to stop my code on the
>>main form
>>
>>
>>Private Sub Form_Current()

>>End Sub
>>
>
> ummm...
>
> You're setting some variables. You're not doing anything with them, and
> not
> telling us enough information that we could offer any advice on what to do
> with them.
>
> What's the Recordsource of the subform? What determines whether or not it
> has
> records? What is its Master Link Field and Child Link Field?
> --
>
> John W. Vinson [MVP]


From: John W. Vinson on
On Thu, 11 Feb 2010 12:24:33 -0700, "Bre-x" <cholotron(a)hotmail.com> wrote:

>Thank you for answering my question.

I didn't think I had... but glad that your asking it got you in the right
direction!

--

John W. Vinson [MVP]