[AccessD] Requery a query

Heenan, Lambert Lambert.Heenan at chartisinsurance.com
Thu May 20 12:33:07 CDT 2010


??? 

There must be something else going on. 

I just built a form based on this query...

SELECT [2008_Yields_tbl].ID, [2008_Yields_tbl].s2008TblYield, [2008_Yields_tbl].DatePreserved 
FROM 2008_Yields_tbl;

And then I added a calculated field ([ID].[Caption] AS Acaption) to it...

SELECT [2008_Yields_tbl].ID, [2008_Yields_tbl].s2008TblYield, [2008_Yields_tbl].DatePreserved, [ID].[Caption] AS ACaption
FROM 2008_Yields_tbl;

But when I when open the form Access prompts for the 'parameter' "ID.Caption", which is what I would expect it to do as the query does not know where to find the ID.Aption value.

This does not fit with your assertion that  Access just reads the caption value.

Puzzled,

Lambert

-----Original Message-----
From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dale_Anne Kalsow
Sent: Thursday, May 20, 2010 1:09 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Requery a query

access is reading [lblDate].[caption] when the form opens.

--- On Thu, 5/20/10, Heenan, Lambert <Lambert.Heenan at chartisinsurance.com> wrote:


From: Heenan, Lambert <Lambert.Heenan at chartisinsurance.com>
Subject: Re: [AccessD] Requery a query
To: "Access Developers discussion and problem solving" <accessd at databaseadvisors.com>
Date: Thursday, May 20, 2010, 11:49 AM


How does lblDate.Caption get into the source query qryrptJobs? This posted SQL has no reference to any form, so presumably you have some reference to the form in qryrptJobs.

Lambert

-----Original Message-----
From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dale_Anne Kalsow
Sent: Thursday, May 20, 2010 12:37 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Requery a query

Sure - the sql code in my query is:
 
SELECT qryrptJobs.JobNumber, qryrptJobs.JobDescription, qryrptJobs.JustScheduledStartDate, qryrptJobs.JustScheduledCompletationDate, CDate([lblDate].[caption]) AS Expr1 FROM qryrptJobs WHERE (((CDate([lblDate].[caption])) Between [JustScheduledStartDate] And [JustScheduledCompletationDate])); 
 
Thanks!
 
Dale

--- On Thu, 5/20/10, Heenan, Lambert <Lambert.Heenan at chartisinsurance.com> wrote:


From: Heenan, Lambert <Lambert.Heenan at chartisinsurance.com>
Subject: Re: [AccessD] Requery a query
To: "Access Developers discussion and problem solving" <accessd at databaseadvisors.com>
Date: Thursday, May 20, 2010, 11:21 AM


The answer may well depend on how you retrieve the value the first time around. Can you post the SQL/code?

Lambert 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dale_Anne Kalsow
Sent: Thursday, May 20, 2010 12:18 PM
To: Access Developers discussion and problem solving
Subject: [AccessD] Requery a query


Good Morning,
 
I have a query that supports a combo box.  Part of the underlaying query gets a value from a label on its form.  The query works great when the form is open - it returns (uses) the correct value.  My problem is when I change the value stored in the label (through code) and tell the combo box to do a requery (me.Combo0.Requery).  It does it but the new value of the label is not used but rather what the data was in the label when the form was reopened.  
 
Does anyone know how to tell the combo box's query to go and reread the value in the label?
 
thanks!
 
Dale


      
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



      
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



      
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list