Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access 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 August 4th, 2004, 01:17 PM
tmc tmc is offline
Registered User
 
Join Date: Aug 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default form opens another form

I borrowed the customer phone list form from the Northwinds.mdb.
It lists customer alphabetically. I added some code that causes another form to open when clicked on the customers last name.
How can i make this second form open to the record pertaining to the last name that is clicked and not this first redord thats in the table. here is th code i am using to open the second form, how can it be changed?


Private Sub CustomerName_DblClick(Cancel As Integer)
On Error GoTo Err_List0_DblClick

    Dim DocName As String

    DocName = "frmCustInfo"
    DoCmd.OpenForm DocName, , , , , , frmCustInfo


Exit_List0_DblClick:
    Exit Sub

Err_List0_DblClick:
    MsgBox Err.Description
    Resume Exit_List0_DblClick
End Sub
 
Old August 4th, 2004, 02:27 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

Dim DocName as String
Dim strLinkCriteria as String

strLinkCriteria = "[CustomerName] = '" & Me.CustomerName & "'"

DoCmd.OpenForm DocName, , , strLinkCriteria

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old August 4th, 2004, 02:29 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

Oh, I forgot to include

DocName = "frmCustInfo"

before the strLinkCriteria line.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old August 4th, 2004, 02:42 PM
tmc tmc is offline
Registered User
 
Join Date: Aug 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks so much, it works perfectly...





Similar Threads
Thread Thread Starter Forum Replies Last Post
Close all MdiChield form from open one form/Button salman .NET Framework 2.0 6 December 10th, 2007 03:21 AM
Want to perform a task after a form opens/displays EdAROC Access VBA 1 June 8th, 2007 08:18 AM
form that opens reports and closes form hartliec Access 1 December 13th, 2006 09:00 AM
Converting an HTML Form to ASP.Net Form k_alidxb75 ASP.NET 1.x and 2.0 Application Design 0 November 30th, 2006 03:26 AM
FORM action opens in new window nancy HTML Code Clinic 2 April 7th, 2006 08:16 AM





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