A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Opening a form and setting filter



 
 
Thread Tools Display Modes
  #1  
Old June 2nd, 2004, 04:27 AM
Smiller
external usenet poster
 
Posts: n/a
Default Opening a form and setting filter

This is an easy one for those who know!!!

I want to open a form and set a filter.

I have the following line as code:

DoCmd.OpenForm "SalesbyProductDetailedForm", , , "[Salesby
ProductDetailedForm]![ProductCode] = " & Me![ProductCode]

the problem is that the end of the statement
Me![ProductCode] needs to be enclosed in quotes to work
properly. how does this line need to be modified?

Thank you
  #2  
Old June 2nd, 2004, 04:38 AM
Paul Johnson
external usenet poster
 
Posts: n/a
Default Opening a form and setting filter

DoCmd.OpenForm "SalesbyProductDetailedForm", , ,
"[SalesbyProductDetailedForm]![ProductCode] = '" & Me![ProductCode] & "'"

Notice the single-quote (apostrophe) before the first double-quote and
between the last pair of double-quotes. Single-quotes are enough to enclose
the string expression in your Where Condition statement.

Paul Johnson
Alexandria, VA

"Smiller" wrote in message
...
This is an easy one for those who know!!!

I want to open a form and set a filter.

I have the following line as code:

DoCmd.OpenForm "SalesbyProductDetailedForm", , , "[Salesby
ProductDetailedForm]![ProductCode] = " & Me![ProductCode]

the problem is that the end of the statement
Me![ProductCode] needs to be enclosed in quotes to work
properly. how does this line need to be modified?

Thank you



  #3  
Old June 2nd, 2004, 04:58 AM
smiller
external usenet poster
 
Posts: n/a
Default Opening a form and setting filter

That is so close...but I'm getting an extra apace before
the Me![ProductCode] value. How do I get rid of it?

Thanks
-----Original Message-----
DoCmd.OpenForm "SalesbyProductDetailedForm", , ,
"[SalesbyProductDetailedForm]![ProductCode] = '" & Me!

[ProductCode] & "'"

Notice the single-quote (apostrophe) before the first

double-quote and
between the last pair of double-quotes. Single-quotes

are enough to enclose
the string expression in your Where Condition statement.

Paul Johnson
Alexandria, VA

"Smiller" wrote in

message
...
This is an easy one for those who know!!!

I want to open a form and set a filter.

I have the following line as code:


DoCmd.OpenForm "SalesbyProductDetailedForm", , , "[Salesby
ProductDetailedForm]![ProductCode] = " & Me!

[ProductCode]

the problem is that the end of the statement
Me![ProductCode] needs to be enclosed in quotes to work
properly. how does this line need to be modified?

Thank you



.

  #4  
Old June 2nd, 2004, 05:11 AM
smiller
external usenet poster
 
Posts: n/a
Default Opening a form and setting filter

GOT IT THANK YOU!!!
-----Original Message-----
That is so close...but I'm getting an extra apace before
the Me![ProductCode] value. How do I get rid of it?

Thanks
-----Original Message-----
DoCmd.OpenForm "SalesbyProductDetailedForm", , ,
"[SalesbyProductDetailedForm]![ProductCode] = '" & Me!

[ProductCode] & "'"

Notice the single-quote (apostrophe) before the first

double-quote and
between the last pair of double-quotes. Single-quotes

are enough to enclose
the string expression in your Where Condition statement.

Paul Johnson
Alexandria, VA

"Smiller" wrote

in
message
.. .
This is an easy one for those who know!!!

I want to open a form and set a filter.

I have the following line as code:


DoCmd.OpenForm "SalesbyProductDetailedForm", , , "[Salesb

y
ProductDetailedForm]![ProductCode] = " & Me!

[ProductCode]

the problem is that the end of the statement
Me![ProductCode] needs to be enclosed in quotes to

work
properly. how does this line need to be modified?

Thank you



.

.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:28 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.