OpenForm 
Author Message
 OpenForm

I'm working with Access Pro 97, a french version.

I'm trying to open a form with DoCmd.OpenForm in VBA but the Where
clause
doesnt work properly. Each time I open the linked form, all rows are in
the result rather the ones related to the fisrt form. Why?

According the info I have, the line is correct.

DoCmd.OpenForm "frm_customer_contact", acNormal, , [No_customer2] =
Forms![frm_customer]![No_customer1]




Thu, 14 Jun 2001 03:00:00 GMT  
 OpenForm
Will it work if you use quotation marks around the filter?

DoCmd.OpenForm "frm_customer_contact", acNormal, , "[No_customer2] =
Forms![frm_customer]![No_customer1]"

Quote:

>I'm working with Access Pro 97, a french version.

>I'm trying to open a form with DoCmd.OpenForm in VBA but the Where
>clause
>doesnt work properly. Each time I open the linked form, all rows are in
>the result rather the ones related to the fisrt form. Why?

>According the info I have, the line is correct.

>DoCmd.OpenForm "frm_customer_contact", acNormal, , [No_customer2] =
>Forms![frm_customer]![No_customer1]





Fri, 15 Jun 2001 03:00:00 GMT  
 OpenForm

Quote:

> The Where argument must be specified as a string expression, like this:

>   "[No_customer2] = " & Forms![frm_customer]![No_customer1]

I know this is right, but why doesn't the second part of the statement
have to be parenthetical?  Is there a logical reason, or is it just
arbitrary?

--
Tenbroeck G. Smith MA, Project Coordinator
Rollins School of Public Health - Emory University
1462 Clifton Road, Room 513
Atlanta, GA 30322
Work: (404) 727-8450.  Fax:  (404) 727-7261



Mon, 18 Jun 2001 03:00:00 GMT  
 OpenForm
The second part of the statement is not parenthetical because the value of
the control is being used not a string expression.  

For example - then value of Forms![frm_customer]![No_customer1] could be 1
or 1000 or BW19G (or whatever format is being used).  

So - in the statement:    "[No_customer2] = " &
Forms![frm_customer]![No_customer1]

the value in: [No_customer2]
will be the value of: Forms![frm_customer]![No_customer1]
and not the literal: "Forms![frm_customer]![No_customer1]"

Hope this didn't confuse you even more....<g>

SMDavis



Quote:

> > The Where argument must be specified as a string expression, like this:

> >   "[No_customer2] = " & Forms![frm_customer]![No_customer1]

> I know this is right, but why doesn't the second part of the statement
> have to be parenthetical?  Is there a logical reason, or is it just
> arbitrary?

> --
> Tenbroeck G. Smith MA, Project Coordinator
> Rollins School of Public Health - Emory University
> 1462 Clifton Road, Room 513
> Atlanta, GA 30322
> Work: (404) 727-8450.  Fax:  (404) 727-7261



Mon, 18 Jun 2001 03:00:00 GMT  
 OpenForm
Thanx Weyerhaeuser!  Great explanation!  It all seems so simple now, but
when I was trying to figure it out myself, I just couldn't put it
together.

--
Tenbroeck G. Smith MA, Project Coordinator
Rollins School of Public Health - Emory University
1462 Clifton Road, Room 513
Atlanta, GA 30322
Work: (404) 727-8450.  Fax:  (404) 727-7261



Mon, 18 Jun 2001 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Inconsistent OpenForm

2. the OpenForm action was canceled

3. OpenForm action was canceled

4. Sandra Daigle - OpenForm

5. Whats wrong with SQL statement for OpenForm

6. Openform method

7. DoCmd.OpenForm Criteria question

8. docmd.openform error

9. DoCmd.OpenForm

10. Bring back name of openform as string

11. OpenForm called form Visual Basic 4.0

12. passing variables to openform where clause

 

 
Powered by phpBB® Forum Software