AccessDiscussion 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
I am using a list box to select the record to display when opening another form in Access 2002(XP). When I run this code from a command button, I get an error message that says:
Run-time error '2450':
Microsoft Access can't find the form 'frmTest' referred to in a macro expression or Visual Basic code.
The form that won't open is in the same database and can be opened by this code:
DoCmd.OpenForm "frmTest"
Here is my code:
Dim rst As Recordset
Set rst = Forms!frmTest.RecordsetClone 'here is where the code stops
rst.Find "CustomerNumber = " & List0
Forms!frmTest.Bookmark = rst.Bookmark
DoCmd.Close acForm, "frmGoToRecordDialog"
Not sure if this will fix yr problem or not - but try getting rid of the bang (!), as it's really just a remnant of the past - try using either
Forms.frmTest
or
Form_frmTest
HTH
Steven
I am a loud man with a very large hat. This means I am in charge
Thanks for the reply Steven. I tried you suggestion, but I am still having problems and think maybe I should just make it a VB application. It will be a lot more work, but VB seems to be more stable for me.
Thanks a lot for the help. I followed an example in a VB6 manual and it wouldn't work. I guess it shouldn't have worked. It seems really simple when you get the code right, huh?