473,387 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

DoCmd.OpenForm ---- I don't know how to make my filter work

68
Hi!
This is one of those things that people either can do really easily or have no idea. I'm in the no idea catagory.

In a super-simplified example:
Form1 has a field "Customer". I want a button that will open Form2 and filter the records where Form2 "Customer" is the same.

The part in bold is the problem. I don't know if I tried it this way (I usually have something in quotes), but every single thing I've tried pulls up all the records or none of the records. Could someone please tell me what should go in the bold section?

Thanks a ton!!!


Dim strCustomer as string

strCustomer = Me.Customer

DoCmd.OpenForm "Form2", acNormal, Form2.Customer = strCustomer
Apr 13 '07 #1
3 2680
ADezii
8,834 Expert 8TB
Hi!
This is one of those things that people either can do really easily or have no idea. I'm in the no idea catagory.

In a super-simplified example:
Form1 has a field "Customer". I want a button that will open Form2 and filter the records where Form2 "Customer" is the same.

The part in bold is the problem. I don't know if I tried it this way (I usually have something in quotes), but every single thing I've tried pulls up all the records or none of the records. Could someone please tell me what should go in the bold section?

Thanks a ton!!!

Dim strCustomer as string

strCustomer = Me.Customer

DoCmd.OpenForm "Form2", acNormal, Form2.Customer = strCustomer
DoCmd.OpenForm "Form2", acNormal, ,"[Customer] = '" & strCustomer & "'"
Apr 13 '07 #2
dk4300
68
DoCmd.OpenForm "Form2", acNormal, ,"[Customer] = '" & strCustomer & "'"
Thank you so much! I totally get it now, an just finished updating my forms w/ all sorts of filter conditions.
Just what I needed.
Thanks!
Apr 16 '07 #3
ADezii
8,834 Expert 8TB
Thank you so much! I totally get it now, an just finished updating my forms w/ all sorts of filter conditions.
Just what I needed.
Thanks!
You are quite welcome.
Apr 16 '07 #4

Sign in to post your reply or Sign up for a free account.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.