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 January 2nd, 2004, 05:38 PM
Registered User
 
Join Date: Jan 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default simple example in book ??

In the book: Beginning Access 2002 VBA, on page 204:
There is a very simple example of creating a FormA and a FormB and adding some code. I'm using Office 2003 and can't get this to work. My Public procedure is not being recognized by the other Form. Can public procedures be written in Forms, or just in modules?

 
Old January 5th, 2004, 05:47 PM
Registered User
 
Join Date: Jan 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've got this worked out if anyone's interested.

 
Old January 6th, 2004, 01:33 PM
Authorized User
 
Join Date: Dec 2003
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think you have to put the Public statement in a module. (not a class module)

Nashville_Bill
 
Old January 7th, 2004, 12:47 PM
Registered User
 
Join Date: Jan 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I had to call the Public procedure very explicitly:
formA code: (I renamed the proc. in formB to "Terry")

Private Sub btnTerry_Click()
  'Terry This doesn't work even though Terry is Public
  Form_frmFormB.Terry 'this works
End Sub

I also had some syntax problems with msgBox but is ok now.






Similar Threads
Thread Thread Starter Forum Replies Last Post
After completing this book. Then which book shoul? zhshqzyc ASP.NET 2.0 Basics 4 January 28th, 2009 07:20 AM
Help,I can't find my book in your book list. 5uer All Other Wrox Books 2 August 21st, 2004 12:43 AM
I can't find my book in your book list. duxn_79 All Other Wrox Books 2 July 13th, 2004 01:58 AM
I can't find my book in your book list. Vincent Yang All Other Wrox Books 1 July 5th, 2004 12:34 PM





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