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 April 16th, 2004, 06:12 PM
lxu lxu is offline
Authorized User
 
Join Date: Oct 2003
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default Runtime error - 2456

Please help me to figure out what's wrong here. Thanks in advance,


Here are the tables:
==================
Tbl-1
Class-Name Attribute-Name Code-List-Name
...
Classification MyTest AccessRestrictionCode
…

Tbl-2
Code-List-Name Code-List-Type Definition
…
AccessRestriction enumerated my def
…

Here are the forms:
==================
- [Attribute-subform] on Form-1. A field,ItemID, on the subform.
- Double clicking on the value “Code” in the ItemID column of the subform,
- Check table-1 and find a record
      Class-Name = ‘Classification’,
      Attribute-Name = ‘MyTest’
      Code-List-Name = ‘AccessRestrictionCode'
- Then Open up Form-2 which has a Combo box [Code-List-Name] (unbound) with a list of code-list-names in tbl-2

I want to find ‘AccessRestrictionCode’ in the combo box, then display other fields (type, definition, source) in a subform on form 2

Here is the code
================
' DblClick event from Form-1
Private Sub code_DblClick(cancel as Integer)
    dim cd as string

    ' call a sub to found cd = AccessRestrictionCode
    cd = getCdFromTable_1

    ' open form 2
     DoCmd.OpenForm "Form-2"

     ' find 'AccessRestrictionCode' in the combo box
     if Len(trim(cd)) > 0 then
         Dim rs As Object
    Set rs = Forms![Form-2].Recordset.Clone
             rs.FindFirst "[Code-List-Name] = '" & cd & "'"
             If Not rs.EOF Then
             Forms![Form-2].Bookmark = rs.Bookmark

    (runtime error occurs on the following code. “myProj data can’t find the field ‘|’ referred to in your expression – runtime 2456)

             Forms![Form-2].[Code-List-Name] = [Code-List-Name]

    end if
end sub

What is wrong for the code "Forms![Form-2].[Code-List-Name] = [Code-List-Name]? What does '|' means here?


Thanks again

Lx







Similar Threads
Thread Thread Starter Forum Replies Last Post
hi i got runtime error 13 Type Mismatch error sriharsha345 Access VBA 2 February 21st, 2008 09:30 AM
runtime error dhoward VB.NET 2002/2003 Basics 2 November 1st, 2007 03:30 PM
Runtime Error whiterainbow ASP.NET 2.0 Professional 2 September 12th, 2006 01:20 AM
mysterious error runtime error '451' coyotworks Excel VBA 1 May 12th, 2006 03:57 PM
Runtime Error rwiethorn ASP.NET 1.0 and 1.1 Basics 1 January 27th, 2004 02:01 PM





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