Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 30th, 2004, 02:17 PM
Authorized User
 
Join Date: Sep 2004
Location: Twickenham, , United Kingdom.
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Paulsh Send a message via Yahoo to Paulsh
Default Opening forms from other forms

When in Access, is it possible after opening a form, for a control on that form (click) to open a second form?

Thanks
Paul

__________________
Paul
Reply With Quote
  #2 (permalink)  
Old September 30th, 2004, 06:54 PM
Friend of Wrox
 
Join Date: Jul 2003
Location: South San Francisco, CA, USA.
Posts: 128
Thanks: 0
Thanked 1 Time in 1 Post
Default

Paul,
Yes, I have done it in most of my forms.
How it works is, you need to have a index field value to
reference the second form record to open.
Code example:

Private Sub Open_Form_Name_Click()
On Error GoTo Err_Open_Form_Name_Click

  Dim strfrm As String
  Dim strWhere As String

  strfrm = "Form - " & [Form_Name]
  strWhere = "ID = " & Me!ID
  DoCmd.OpenForm FormName:=strfrm, WhereCondition:=strWhere

Exit_Open_Form_Name_Click:
  Exit Sub

Err_Open_Form_Name_Click:
  Resume Exit_Open_Form_Name_Click

End Sub

Hope this helps.
John
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening 1 form from 2 forms rocknrisk Access 5 July 29th, 2005 06:05 PM
Help with opening and closing forms Dwizz VB.NET 2002/2003 Basics 4 April 21st, 2005 03:19 AM
opening and closing forms mp VB.NET 2002/2003 Basics 6 April 2nd, 2005 07:37 PM
how can I speed up the opening of forms? Mihai B Access VBA 6 March 14th, 2005 06:05 AM
Closing and Opening Forms Louisa VB.NET 2002/2003 Basics 1 February 5th, 2004 02:40 PM



All times are GMT -4. The time now is 05:39 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.