From: Peter on
Hi All...

I use a popup form to copy text from textfield from an open form..

I want to use this code

If Forms.[Fruitsbasket].[Fruits] = "Yellow" Then
Me.[Fruittype] = "1st_Banana"
End If

I want to use five If's..but for some reason..it does not fire the first
line of IF code...why is that?

Thanks!
From: Mike Painter on
Peter wrote:
> Hi All...
>
> I use a popup form to copy text from textfield from an open form..
>
> I want to use this code
>
> If Forms.[Fruitsbasket].[Fruits] = "Yellow" Then
> Me.[Fruittype] = "1st_Banana"
> End If
>
> I want to use five If's..but for some reason..it does not fire the
> first line of IF code...why is that?
>
> Thanks!

The only reasons a line would not "fire" would be if there was something
previous that skipped over it or the code was in the wrong event.


From: Peter on
Thanks Mike..but i do not recevie any error message..the only "line" it the
Sub text "Private Sub Form_Load()" ????????

Thanks!

"Mike Painter" wrote:

> Peter wrote:
> > Hi All...
> >
> > I use a popup form to copy text from textfield from an open form..
> >
> > I want to use this code
> >
> > If Forms.[Fruitsbasket].[Fruits] = "Yellow" Then
> > Me.[Fruittype] = "1st_Banana"
> > End If
> >
> > I want to use five If's..but for some reason..it does not fire the
> > first line of IF code...why is that?
> >
> > Thanks!
>
> The only reasons a line would not "fire" would be if there was something
> previous that skipped over it or the code was in the wrong event.
>
>
> .
>
From: Stuart McCall on
"Peter" <Peter(a)discussions.microsoft.com> wrote in message
news:50F3604B-4968-4D4A-AAFF-FAE8488D2F62(a)microsoft.com...
> Hi All...
>
> I use a popup form to copy text from textfield from an open form..
>
> I want to use this code
>
> If Forms.[Fruitsbasket].[Fruits] = "Yellow" Then
> Me.[Fruittype] = "1st_Banana"
> End If
>
> I want to use five If's..but for some reason..it does not fire the first
> line of IF code...why is that?
>
> Thanks!

If Forms![Fruitsbasket].[Fruits] = "Yellow" Then

Notice I changed from Forms. to Forms!

Forms is a collection containing references to all open forms. To refer to a
member of a collection by name, use the Bang (!) syntax as above or
Forms("Fruitsbasket")

Dot is used for properties and methods.