Error 2465 while opening a form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ontherun
    New Member
    • Mar 2007
    • 55

    Error 2465 while opening a form

    hi,

    i have two forms CHS_Customer and 'CHS_Job'
    both have a common field, "Company_Na me"

    i want to open the form 'CHS_Job' from the form 'CHS_Customer ' and when i open, the Company_Name field value in 'CHS_Customer' but be assigned to Company_name field in 'CHS_Job'

    i have written some code for the button "Enter Job" in the Form 'CHS_Customer '

    Private Sub EnterJobLabel_C lick()

    DoCmd.DoMenuIte m acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

    DoCmd.OpenForm "CHS_Job"
    DoCmd.GoToRecor d , , acNewRec

    [Form_CHS_Job].Company_Name.V alue = Company_Name.Va lue

    End Sub



    the above code gives run time error 2465: Access cant find the field ' I ' referred to in the application.

    I have checked the fields and there is nothing wrong.

    what would be the problem??
    need your assiatance

    thanks n regards,
    Kathy
  • kepston
    Recognized Expert New Member
    • May 2007
    • 97

    #2
    I think this
    [CODE=vb][Form_CHS_Job].Company_Name.V alue = Company_Name.Va lue[/CODE]
    should be
    [CODE=vb]Forms![Form_CHS_Job]!Company_Name.V alue = Company_Name.Va lue[/CODE]

    Comment

    • puppydogbuddy
      Recognized Expert Top Contributor
      • May 2007
      • 1923

      #3
      Originally posted by ontherun
      hi,

      i have two forms CHS_Customer and 'CHS_Job'
      both have a common field, "Company_Na me"

      i want to open the form 'CHS_Job' from the form 'CHS_Customer ' and when i open, the Company_Name field value in CHS_Customer but be assigned to Company_name field in 'CHS_Job'

      i have written some code for the button "Enter Job" in the Form 'CHS_Customer '

      Private Sub EnterJobLabel_C lick()

      DoCmd.DoMenuIte m acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

      DoCmd.OpenForm "CHS_Job"
      DoCmd.GoToRecor d , , acNewRec

      [Form_CHS_Job].Company_Name.V alue = Company_Name.Va lue

      End Sub



      the above code gives run time error 2465: Access cant find the field ' I ' referred to in the application.

      I have checked the fields and there is nothing wrong.

      what would be the problem??
      need your assiatance

      thanks n regards,
      Kathy
      Hi Kathy,
      When you have more than one form opened at the same time, you need to use fully qualified references as shown:

      Change this:
      [Form_CHS_Job].Company_Name.V alue = Company_Name.Va lue

      To this:
      Forms![Form_CHS_Job]!Company_Name.V alue = Forms!CHS_Custo mer!Company_Nam e.Value

      Comment

      • ontherun
        New Member
        • Mar 2007
        • 55

        #4
        Kepston and Puppy,


        U guys rock... man, it solved the problem ..

        thanks guys..thanks a lot...

        take care

        chuz,
        Kathy

        Comment

        Working...