Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 2nd, 2009, 04:41 PM
Registered User
 
Join Date: Feb 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Refer to Value in Query to set TextBox's Visibility

I have the following query created within Access (qryClientNotActive)

SELECT person_history.person_history_key, client.client_key, client_site.client_site_key, client.company_name, client_site.id_code, [client].[company_name]+", "+[client_site].[id_code] AS Expr1, client.active, client_site.active
FROM client INNER JOIN ((person_history INNER JOIN person ON person_history.person_key = person.person_key) INNER JOIN client_site ON person_history.client_site_key = client_site.client_site_key) ON client.client_key = client_site.client_key;

I have a form, (frmProfile_person_history_subform) with a text box, whose visible = No, (txtClientNotActive). I need txtClientNotActive to be visible once client.active and client_site.active are set to No.

I'm thinking there should be a way to call a value in a query behind the scenes in VBA, but I cannot figure it out.

Thanks.
 
Old February 5th, 2009, 05:55 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Is this query the record source for the form in question? If so, do you have checkboxes on the form for client.active and client_site.active (assuming they're of type yes/no)? If so, then assuming their names are chkClientActive and chkClientSiteActive, respectively:

Code:
Me.txtClientNotActive.Visible = (Not Me.chkClientActive And Not Me.chkClientSiteActive)
__________________
Greg Serrano
Michigan Dept. of Environmental Quality
Air Quality Division





Similar Threads
Thread Thread Starter Forum Replies Last Post
Binding IEnumerable result set of a LINQ query prakashbpl .NET Framework 3.5 0 November 11th, 2008 04:41 AM
TextBox's ReadOnly problem ... amolchikurte ASP.NET 2.0 Professional 4 May 31st, 2007 06:37 AM
Set Panel Visibility Problem niceFEPF C# 2005 0 November 21st, 2006 06:34 PM
How to set properties of query in Access VBA LittleCity Access VBA 2 September 27th, 2006 08:42 AM
Set query up to automatically run in SQL server ALLA SQL Server 2000 3 October 21st, 2004 04:24 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.