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 December 30th, 2003, 05:53 PM
Authorized User
 
Join Date: Dec 2003
Location: Nashville, Tennessee, USA.
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
Reply With Quote
  #2 (permalink)  
Old January 2nd, 2004, 10:31 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: Houston, Texas, USA.
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
Reply With Quote
  #3 (permalink)  
Old January 9th, 2004, 07:47 PM
Registered User
 
Join Date: Jan 2004
Location: none, none, Canada.
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
Reply With Quote
  #4 (permalink)  
Old January 23rd, 2004, 05:03 PM
Friend of Wrox
 
Join Date: Jul 2003
Location: Houston, Texas, USA.
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
Reply With Quote
  #5 (permalink)  
Old May 30th, 2006, 11:20 PM
Registered User
 
Join Date: May 2006
Location: sydney, new south wales, Australia.
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

Reply With Quote
  #6 (permalink)  
Old May 31st, 2006, 07:09 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
  #7 (permalink)  
Old May 31st, 2006, 07:11 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
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
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



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


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