Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / July 2006

Tip: Looking for answers? Try searching our database.

How do I check what parameter value is being passed to a query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter Clancy - 11 Jul 2006 16:26 GMT
I am amending an Access database that I have taken responsibility for so I
dont know all the intricacies of how it was build.  There is a form that has
a custom toolbar which includes a couple of buttons that appear to run
reports . The reports have as their source queries, which should take values
from this form, but when I push the button, I get a prompt to enter the
required parameter, instead of it passing the values through. Is there a way
of debugging this so that I can see what is going on?
Thanks
Brian - 11 Jul 2006 19:49 GMT
Open the query in design view and ensure that the form controls referenced in
the parameters actually exist on the form. Try posting a specific example. It
should look like [Forms]![YourForm]![ControlName] in the query.

> I am amending an Access database that I have taken responsibility for so I
> dont know all the intricacies of how it was build.  There is a form that has
[quoted text clipped - 4 lines]
> of debugging this so that I can see what is going on?
> Thanks
Peter Clancy - 13 Jul 2006 17:02 GMT
Brian,
Yes it does look like that.  Specifically in SQL view the query looks like:

SELECT Tblrequests.ID,
TblTelcoInfo.[Telco CLI],
TblTelcoInfo.[Telco Details],
Tblrequests.Ref,
Tblrequests.TheirRef,
[Tblrequests].DateReceived AS Expr1,
[Tblrequests].DateReturned AS Expr2
FROM TblTelcoInfo
LEFT JOIN Tblrequests ON TblTelcoInfo.[Telco CLI] = Tblrequests.TelcoCLI
WHERE (((Tblrequests.ID)=[Forms]![frmRequests]![ID]));

Now as I read this I realise that it is prompting for the DateReceived and
DateReturned values, which it should not do, it should take those values from
the ID passed through from the frmRequests ID field.
This is very strange.

> Open the query in design view and ensure that the form controls referenced in
> the parameters actually exist on the form. Try posting a specific example. It
[quoted text clipped - 8 lines]
> > of debugging this so that I can see what is going on?
> > Thanks
Brian - 13 Jul 2006 17:21 GMT
Notice that the square brackets are around the Tblrequests only before the
two date field references and that both are showing up as Expr1/Expr2. I'mo
not sure here without testing, but I think the square brackets may be
indicating to the system that the contents are the name of a parameter and
not the table name. The other square brackets (on field names) are necessary
because of the spaces in the field names.

Try this instead:

SELECT Tblrequests.ID,
TblTelcoInfo.[Telco CLI],
TblTelcoInfo.[Telco Details],
Tblrequests.Ref,
Tblrequests.TheirRef,
Tblrequests.DateReceived,
Tblrequests.DateReturned
FROM TblTelcoInfo
LEFT JOIN Tblrequests ON TblTelcoInfo.[Telco CLI] = Tblrequests.TelcoCLI
WHERE (((Tblrequests.ID)=[Forms]![frmRequests]![ID]));

> Brian,
> Yes it does look like that.  Specifically in SQL view the query looks like:
[quoted text clipped - 5 lines]
> Tblrequests.TheirRef,
> [Tblrequests].DateReceived AS Expr1,
1> [Tblrequests].DateReturned AS Expr2
> FROM TblTelcoInfo
> LEFT JOIN Tblrequests ON TblTelcoInfo.[Telco CLI] = Tblrequests.TelcoCLI
[quoted text clipped - 17 lines]
> > > of debugging this so that I can see what is going on?
> > > Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.