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 » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Parameter Query Using Combo Box



 
 
Thread Tools Display Modes
  #1  
Old May 27th, 2010, 09:05 PM posted to microsoft.public.access.queries
pleasehelpme
external usenet poster
 
Posts: 4
Default Parameter Query Using Combo Box

There are no recorsd being returned when i run my parameter query.

SELECT TrackingID, DocumentNumber,DocumentType, RequestDate,DueDate,
ProgramID, AssignedTo, Author, StatusDate,Subject,Notes
FROM tblDocTracking
WHERE (((tblDocTracking.ProgramID)=[forms]![frmProgramSelect]![ProgramID]));

I have frmProgramSelect open.

I am not sure what i am doing wrong. Can you help?
  #2  
Old May 27th, 2010, 09:39 PM posted to microsoft.public.access.queries
vanderghast
external usenet poster
 
Posts: 593
Default Parameter Query Using Combo Box

Be sure the control ProgramID is out of focus, to be sure that the value you
keyed in has been "updated". If the control is not updated (committed),
its last committed value, probably a null, will be used by the query.


Vanderghast, Access MVP



"PleaseHelpMe" wrote in message
...
There are no recorsd being returned when i run my parameter query.

SELECT TrackingID, DocumentNumber,DocumentType, RequestDate,DueDate,
ProgramID, AssignedTo, Author, StatusDate,Subject,Notes
FROM tblDocTracking
WHERE
(((tblDocTracking.ProgramID)=[forms]![frmProgramSelect]![ProgramID]));

I have frmProgramSelect open.

I am not sure what i am doing wrong. Can you help?


  #3  
Old May 27th, 2010, 09:44 PM posted to microsoft.public.access.queries
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Parameter Query Using Combo Box

Any chance that the ?combobox field in your expression ([ProgramID] doesn't
actually hold the ProgramID field?

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"PleaseHelpMe" wrote in message
...
There are no recorsd being returned when i run my parameter query.

SELECT TrackingID, DocumentNumber,DocumentType, RequestDate,DueDate,
ProgramID, AssignedTo, Author, StatusDate,Subject,Notes
FROM tblDocTracking
WHERE
(((tblDocTracking.ProgramID)=[forms]![frmProgramSelect]![ProgramID]));

I have frmProgramSelect open.

I am not sure what i am doing wrong. Can you help?



  #4  
Old May 27th, 2010, 11:35 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Parameter Query Using Combo Box

Did you make a selection in the Combo before running the query?

If you want all records whereby you do not make a selection try using this --

SELECT TrackingID, DocumentNumber,DocumentType, RequestDate,DueDate,
ProgramID, AssignedTo, Author, StatusDate,Subject,Notes
FROM tblDocTracking
WHERE tblDocTracking.ProgramID Like
IIF([forms]![frmProgramSelect]![ProgramID] Is Null, "*",
[forms]![frmProgramSelect]![ProgramID]);

--
Build a little, test a little.


"PleaseHelpMe" wrote:

There are no recorsd being returned when i run my parameter query.

SELECT TrackingID, DocumentNumber,DocumentType, RequestDate,DueDate,
ProgramID, AssignedTo, Author, StatusDate,Subject,Notes
FROM tblDocTracking
WHERE (((tblDocTracking.ProgramID)=[forms]![frmProgramSelect]![ProgramID]));

I have frmProgramSelect open.

I am not sure what i am doing wrong. Can you help?

  #5  
Old May 27th, 2010, 11:50 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Parameter Query Using Combo Box

Another way (copied from John Spencer post) --
SELECT TrackingID, DocumentNumber,DocumentType, RequestDate,DueDate,
ProgramID, AssignedTo, Author, StatusDate,Subject,Notes
FROM tblDocTracking
WHERE tblDocTracking.ProgramID Like
Nz([forms]![frmProgramSelect]![ProgramID], "*");

--
Build a little, test a little.


"PleaseHelpMe" wrote:

There are no recorsd being returned when i run my parameter query.

SELECT TrackingID, DocumentNumber,DocumentType, RequestDate,DueDate,
ProgramID, AssignedTo, Author, StatusDate,Subject,Notes
FROM tblDocTracking
WHERE (((tblDocTracking.ProgramID)=[forms]![frmProgramSelect]![ProgramID]));

I have frmProgramSelect open.

I am not sure what i am doing wrong. Can you help?

  #6  
Old May 28th, 2010, 04:37 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default Parameter Query Using Combo Box

I would like to point out that this works if ProgramID is never null. Also
since you are using LIKE the assumption is that ProgramID is a text field,
although Access will automatically convert the value in the field to a string
in most cases.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

KARL DEWEY wrote:
Another way (copied from John Spencer post) --
SELECT TrackingID, DocumentNumber,DocumentType, RequestDate,DueDate,
ProgramID, AssignedTo, Author, StatusDate,Subject,Notes
FROM tblDocTracking
WHERE tblDocTracking.ProgramID Like
Nz([forms]![frmProgramSelect]![ProgramID], "*");

  #7  
Old June 2nd, 2010, 11:09 PM posted to microsoft.public.access.queries
pleasehelpme
external usenet poster
 
Posts: 4
Default Parameter Query Using Combo Box

I am so embarassed! I didnt actually name the combo box ProgramID! I renamed
and my original coding worked.

Thanks all and sorry for wasting your time!

"Jeff Boyce" wrote:

Any chance that the ?combobox field in your expression ([ProgramID] doesn't
actually hold the ProgramID field?

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"PleaseHelpMe" wrote in message
...
There are no recorsd being returned when i run my parameter query.

SELECT TrackingID, DocumentNumber,DocumentType, RequestDate,DueDate,
ProgramID, AssignedTo, Author, StatusDate,Subject,Notes
FROM tblDocTracking
WHERE
(((tblDocTracking.ProgramID)=[forms]![frmProgramSelect]![ProgramID]));

I have frmProgramSelect open.

I am not sure what i am doing wrong. Can you help?



.

 




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 12:17 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.