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 December 30th, 2003, 05:53 PM
Authorized User
 
Join Date: Dec 2003
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default Run-time error '2450'

I am using a list box to select a record to be displayed in another form. I get an error message "Run-time error '2450' Microsoft Access can't find the form 'frmTest' referred to in a macro expression or Visual Basic code." The form does exist and it is in the same database. I am using Access 2002. Here is my code:

Dim rst As Recordset
Set rst = Forms!frmTest.RecordsetClone 'This is where the code stops.
rst.Find "CustomerNumber = " & List0
Forms!frmTest.Bookmark = rst.Bookmark
DoCmd.Close acForm, "frmGoToRecordDialog"

I can open frmTest with this:

DoCmd.OpenForm "frmTest"

Thanks for the help!



Nashville_Bill
__________________
Nashville_Bill
 
Old January 2nd, 2004, 10:31 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Once the form is opened, you can set the recordsource as follows:

Set rst = Me.RecordsetClone

But to open a form with a recordset based on the criteria selected in a list box or text box, your code would look something like the following:

Dim strCriteria as string

strCriteria = "[CustomerNumber]=" & Me![List0]
DoCmd.OpenForm "frmTest", , , strCriteria

HTH,

Beth Moffitt
 
Old January 9th, 2004, 07:47 PM
Registered User
 
Join Date: Jan 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi guys, i hav similar problems as Nash does. it doesnt allow me to run the following codes:

Private Sub Form_Open(Cancel As Integer)
    Forms![PrintSummaryMenu].Visible = False
End Sub

and the error comes from the Forms![PrintSummaryMenu] line(i guess it is the !)

i am playing with access because i am converting an Access 2.0 to Access XP, is it doable??i am working hard to convert them but the problem seems to come from the compiler and the macros. this is my first posting!!~hehe...Thanks for reading.

hh
 
Old January 23rd, 2004, 05:03 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I just saw this post, but when you convert from 2.0 to xp, you'll probably have issues because DAO is no longer the default. Make sure you have a reference to DAO 3.6 and when you use things like dim db as database and dim rs as recordset, preface the database and recordset with DAO. so it would look like the following:
Dim db as DAO.Database
Dim rs as DAO.Recordset

Regards,

Beth M
 
Old May 30th, 2006, 11:20 PM
Registered User
 
Join Date: May 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ankrups Send a message via Yahoo to ankrups
Default

hi there..

I am having same problem...I need help from linking the forms into other forms. I made default (input) form for certain group so that I have to enter information at once only and it copied it down rest of the form place value. The structure is same to all forms.

For example if I take one group which contain only 3 forms out of one is default (input form) and should copied info to rest of two forms.
[share] = Form 1
[share A]= Form 2
[share B]=Form 3

[share] consist let’s say two combo box(i.e. [combo1] and [combo2]. When I select the value in [share] form of [combo1] it should copied those info to [share A]’s [combo1] and simialry in [share B] and so on.


How do I link these tables. Please help

 
Old May 31st, 2006, 07:09 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I am not sure what you want to do here ankrups. Do you want forms to be opened with a combo box already populated, or do you wan the form to be filtered, or do you want to create a relationship between tables?

Please clarify. I know someone will be able to help here.

mmcdonal
 
Old May 31st, 2006, 07:11 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Also, poor kkmok. Did you ever get your problem resolved. Here is the answer:

DoCmd.OpenForm stDocName, , , , , acHidden

mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Query Error & Run-Time Error 3022 DavidWE Access 1 July 31st, 2008 11:17 AM
run-time error(s) Chacko C++ Programming 0 March 4th, 2007 02:28 PM
run-time error '2450' kk_sg Access VBA 2 August 21st, 2006 10:26 AM
run time error ashishroyk Java GUI 0 October 8th, 2004 01:42 AM
Run Time Error JBond Access VBA 0 May 27th, 2004 09:50 AM





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