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 » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Form to open report based on several combo boxes



 
 
Thread Tools Display Modes
  #1  
Old November 25th, 2008, 09:06 PM posted to microsoft.public.access.gettingstarted
momof2
external usenet poster
 
Posts: 13
Default Form to open report based on several combo boxes

I need to open a report based on three conditions. Contractor, Card, and
Statement, which is provided from combo boxes. I am able to to open the
report based on the Contractor combo box, I'm just not sure how to
incorporate the other two and have them all work together. Here is what I am
using to pull from the contractor combo box. How can I add the other two to
make it all work? Any help is greatly appreicated!

Dim StrWhere As String

StrWhere = "[Contractor] = """ & Me.Contractor & """"


DoCmd.OpenReport "coding", acViewPreview, , StrWhere

  #2  
Old November 25th, 2008, 09:15 PM posted to microsoft.public.access.gettingstarted
Beetle
external usenet poster
 
Posts: 1,254
Default Form to open report based on several combo boxes

This assumes that they are all text data types;

StrWhere = "[Contractor] = """ & Me.Contractor & """ And [Card]= """ _
& Me.Card & """ And [Statement]= """ & Me.Statement & """"


--
_________

Sean Bailey


"Momof2" wrote:

I need to open a report based on three conditions. Contractor, Card, and
Statement, which is provided from combo boxes. I am able to to open the
report based on the Contractor combo box, I'm just not sure how to
incorporate the other two and have them all work together. Here is what I am
using to pull from the contractor combo box. How can I add the other two to
make it all work? Any help is greatly appreicated!

Dim StrWhere As String

StrWhere = "[Contractor] = """ & Me.Contractor & """"


DoCmd.OpenReport "coding", acViewPreview, , StrWhere

  #3  
Old November 25th, 2008, 09:46 PM posted to microsoft.public.access.gettingstarted
momof2
external usenet poster
 
Posts: 13
Default Form to open report based on several combo boxes

I changed it to that now when I go to run it, I get a debug error and the
following comes back highlighted in yellow. Can you help with what is wrong
with this part?

DoCmd.OpenReport "coding", acViewPreview, , StrWhere

"Beetle" wrote:

This assumes that they are all text data types;

StrWhere = "[Contractor] = """ & Me.Contractor & """ And [Card]= """ _
& Me.Card & """ And [Statement]= """ & Me.Statement & """"


--
_________

Sean Bailey


"Momof2" wrote:

I need to open a report based on three conditions. Contractor, Card, and
Statement, which is provided from combo boxes. I am able to to open the
report based on the Contractor combo box, I'm just not sure how to
incorporate the other two and have them all work together. Here is what I am
using to pull from the contractor combo box. How can I add the other two to
make it all work? Any help is greatly appreicated!

Dim StrWhere As String

StrWhere = "[Contractor] = """ & Me.Contractor & """"


DoCmd.OpenReport "coding", acViewPreview, , StrWhere

  #4  
Old November 25th, 2008, 10:25 PM posted to microsoft.public.access.gettingstarted
Beetle
external usenet poster
 
Posts: 1,254
Default Form to open report based on several combo boxes

Are [Contractor], [Card] and [Statement] all text data types, and are
they the bound columns in their respective combo boxes?
--
_________

Sean Bailey


"Momof2" wrote:

I changed it to that now when I go to run it, I get a debug error and the
following comes back highlighted in yellow. Can you help with what is wrong
with this part?

DoCmd.OpenReport "coding", acViewPreview, , StrWhere

"Beetle" wrote:

This assumes that they are all text data types;

StrWhere = "[Contractor] = """ & Me.Contractor & """ And [Card]= """ _
& Me.Card & """ And [Statement]= """ & Me.Statement & """"


--
_________

Sean Bailey


"Momof2" wrote:

I need to open a report based on three conditions. Contractor, Card, and
Statement, which is provided from combo boxes. I am able to to open the
report based on the Contractor combo box, I'm just not sure how to
incorporate the other two and have them all work together. Here is what I am
using to pull from the contractor combo box. How can I add the other two to
make it all work? Any help is greatly appreicated!

Dim StrWhere As String

StrWhere = "[Contractor] = """ & Me.Contractor & """"


DoCmd.OpenReport "coding", acViewPreview, , StrWhere

  #5  
Old December 1st, 2008, 09:01 PM posted to microsoft.public.access.gettingstarted
momof2
external usenet poster
 
Posts: 13
Default Form to open report based on several combo boxes

yes I believe they are

"Beetle" wrote:

Are [Contractor], [Card] and [Statement] all text data types, and are
they the bound columns in their respective combo boxes?
--
_________

Sean Bailey


"Momof2" wrote:

I changed it to that now when I go to run it, I get a debug error and the
following comes back highlighted in yellow. Can you help with what is wrong
with this part?

DoCmd.OpenReport "coding", acViewPreview, , StrWhere

"Beetle" wrote:

This assumes that they are all text data types;

StrWhere = "[Contractor] = """ & Me.Contractor & """ And [Card]= """ _
& Me.Card & """ And [Statement]= """ & Me.Statement & """"


--
_________

Sean Bailey


"Momof2" wrote:

I need to open a report based on three conditions. Contractor, Card, and
Statement, which is provided from combo boxes. I am able to to open the
report based on the Contractor combo box, I'm just not sure how to
incorporate the other two and have them all work together. Here is what I am
using to pull from the contractor combo box. How can I add the other two to
make it all work? Any help is greatly appreicated!

Dim StrWhere As String

StrWhere = "[Contractor] = """ & Me.Contractor & """"


DoCmd.OpenReport "coding", acViewPreview, , StrWhere

 




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 11:18 PM.


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