Results 1 to 2 of 2
  1. #1
    trident is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    141

    trying to find a field that is not in the form

    I created a form in datasheet view to show as a list, in the sheet, the following are



    Form 1 name=fPDI (Form)
    field1 = tpdiid - this is a unique no.

    Datasheet List
    field1 = tpdiid - this is also part of the list.

    now i made a macro button in the datasheet list, that when you click field1 in the datasheet list, it will open the Form 1 in the unique data no. the code i entered is:

    docmd.openform "fPDI",,,"[fPDI.tpdiid]" & [fPDI.tpdiid]

    This is where the problem appears, when i click the tpdiid field in the datasheet view, this error appears:

    Run-Time error '2465'
    Microsoft Office Access can't find the field "|" referred to in your expression

    I deleted the field1 and replaced it again, still the same error.

    I copied the same command from a another database where it works, replaced the right fields, but still the same error.

    I recreated the form from scratch without changing anything, just copy and drag the fields to a blank form and still the problem persist.

    can you please help me on this and explain to me.

    Thank you.

    Trident

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Your description is rather confusing.

    This looks like code, not a macro......
    And you are missing an operator
    Code:
    'this
    docmd.openform "fPDI",,,"[fPDI.tpdiid]" & [fPDI.tpdiid]
    
    ' should be
    
    docmd.openform "fPDI",,,"[tpdiid] = " & Forms!fPDI.tpdiid
    But are you trying to open two copies of the SAME form?


    Maybe you would post your dB? (do a "Compact & Repair", then Zip it)

    How many forms do you have?
    What are the form names?
    What is/are the table(s)?
    What are the fields in the table?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 01-13-2016, 02:04 PM
  2. Replies: 2
    Last Post: 09-20-2014, 11:28 AM
  3. Replies: 11
    Last Post: 11-19-2013, 09:03 AM
  4. Find records based on a field in a form
    By rbw95662 in forum Programming
    Replies: 3
    Last Post: 06-15-2010, 04:12 PM
  5. Replies: 4
    Last Post: 07-22-2009, 02:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums