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 13th, 2010, 01:30 PM
Registered User
 
Join Date: Feb 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Conflicting VBA open function

hi i have a system that is for booking rooms, as i have to split the system for 4 ict rooms, has created the problem. Yet getting rid of these other rooms would not do.

Option Compare Database


Public Function fnbooking()
Forms!frm_roombookingsWICT2.cboDay2.SetFocus
fnbooking = Forms!frm_roombookingsWICT2.cboDay2
End Function
Public Function fnteachers()
Forms!frm_roombookingsWICT2.txtTeachersInitials.Se tFocus
fnteachers = Forms!frm_roombookingsWICT2.txtTeachersInitials
End Function
Public Function fnbooking2()
Forms!frm_roombookingsWICT1.cboDay.SetFocus
fnbooking2 = Forms!frm_roombookingsWICT1.cboDay
End Function

this is the function i am using to define information that is shown in another combo box by the first one setting the paramaters. yet with this it comes up with a problem, when i run this from the wict1 form it highlights a error and needs to be debugs and says Forms!frm_roombookingsWICT2.cboDay2.SetFocus is the problem yet when i run wict2 form with out wict1 there is no problems please help me :(
 
Old March 3rd, 2010, 08:37 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

These functions refer to 2 forms (WICT1 and WICT2). Are both forms open at the time these functions are run? If they are not both open, this will cause an error.
__________________
mmcdonal

Look it up at: http://wrox.books24x7.com
 
Old March 3rd, 2010, 04:27 PM
Registered User
 
Join Date: Feb 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default ive solved it

Public Function fnbooking()
Forms!frm_roombookingsWICT2.cboDay2.SetFocus
fnbooking = Forms!frm_roombookingsWICT2.cboDay2
End Function

Public Function fnbooking2()
Forms!frm_roombookingsWICT1.cboDay.SetFocus
fnbooking2 = Forms!frm_roombookingsWICT1.cboDay
End Function

i know it may look the same its the fact that it wasnt the same in my database for some reason it was missing fnbookings2 on the 3rd line of the second line and now works and my system is now finished :D and allows me to book ict rooms effortlessly if you need help on bookin rooms just ask





Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't open database thru VBA sektor Access VBA 1 September 15th, 2008 11:44 AM
how to open an existing query in VBA michael193nj Access VBA 4 March 26th, 2008 05:09 PM
Conflicting Libraries in VBA References echovue Access VBA 1 July 11th, 2006 10:56 AM
Access VBA - Open a different form... jonwitts Access VBA 3 April 27th, 2005 06:47 AM
compacting an open mdb using VBA Dwight Pro VB 6 5 July 7th, 2004 01:53 PM





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