Wrox Programmer Forums
|
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 12th, 2007, 12:37 PM
Authorized User
 
Join Date: Jan 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default Select form name

Hi

How can I select a form name and feed it into an SQL query? What I want to do is, create an internal help file but filtering by form name. So for example, if you want to add a new record form a form, if you click on the help file it will only display info on how to add. If you are in a delete form, and click help button it will only display info on how to delete (just examples).

Is there any way I can do this?

Lindsey
 
Old February 12th, 2007, 12:44 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Just package it with Me.Name, like this:

Dim sForm, sName, sLink As String
sForm = Me.Name

Then something like:

sLink = "[FormName] = '" & sForm "'"

Then
sName = "rptMyHelpReport"

DoCmd.OpenReport sName, acPreview, , sLink

Check the syntax to make sure you have the sLink in the WHERE clause.

This should work, assuming your report is based on entries that are determined by the form name. You could also do this with button names.

HTH

mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
IE 7 form select options harpua HTML Code Clinic 0 May 9th, 2007 11:59 PM
Is it possible to select record in continous form chiefouko Access VBA 0 July 18th, 2006 04:20 AM
File select on a form Korvath Access 2 February 7th, 2005 11:22 AM
UP AND DOWN IN A SELECT FORM elisabeth Javascript How-To 12 September 24th, 2004 05:49 AM





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