• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 422
  • Last Modified:

Method or data Member not found

When I run the following I receive a Compile Error: Method or  data Member not found

Can any help point out my mistake?

Public Function ap_StandardSearchChoice()
      Dim frmCalling As Form
      Dim frmSearchSub As Form
      Dim dynCalling As Recordset
     
      On Error GoTo Error_ap_StandardSearchChoice
     
      Set frmSearchSub = Forms!Contacts!subSearch.Form
      Set frmCalling = Forms(frmSearchSub.Parent.OpenArgs)
      Set dynCalling = frmCalling.Recordset.Clone
     
      If VarType(dynCalling(frmCalling.Tag)) <> vbString Then
        dynCalling.FindFirst frmCalling.Tag & " = " & frmSearchSub(frmCalling.Tag)
      Else
        dynCalling.FindFirst frmCalling.Tag & " = '" & frmSearchSub(frmCalling.Tag) & "'"
      End If
   
      If dynCalling.NoMatch Then
        MsgBox "An Error has occurred, No match record found!", 32, "Search Error!"
      Else
        frmCalling.Bookmark = dynCalling.Bookmark
      End If
   
      dynCalling.Close
   
      DoCmd.Close acForm, "Contacts"

Exit_ap_StandardSearchChoice:
    Exit Function

Error_ap_StandardSearchChoice:

    MsgBox Err.Description, vbCritical, "Search Error"
    Resume Exit_ap_StandardSearchChoice

End Function
0
Leo_Nel
Asked:
Leo_Nel
  • 2
  • 2
  • 2
  • +3
1 Solution
 
LucasMS Dynamics DeveloperCommented:
on which line you get the errer?
0
 
LucasMS Dynamics DeveloperCommented:
disable your error handler and debug it, that would be easier
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Go to the Debug menu, Compile function, and when you get an error message tell us which line has the yellow highlight bar.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Leo_NelAuthor Commented:
I get the error on this line:

 dynCalling.FindFirst frmCalling.Tag & " = " & frmSearchSub(frmCalling.Tag)
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
>frmSearchSub(frmCalling.Tag)
If frmCalling is a subform within subSearch?
0
 
Leo_NelAuthor Commented:
Yes, there is a SubForm.
0
 
hkang042997Commented:
Is this function in a standard module?  If so, you have to put code in there to make sure that the main form and subform are open in order for you to access the values of the controls.

If you are certain that both forms are open when this function is executed,  then make sure that frmCalling.Tag contains a valid name of a control in the subform.
0
 
ArjiCommented:
I think you aren't correctly addressing the Tag control in your subform.  this assumes there is a control on your subform named Tag.

dynCalling.FindFirst frmCalling.Tag & " = " & [frmCalling].[Form].Tag
0
 
stevbeCommented:
the code you are using is for DAO (.FindFirst). Do you have a reference to Microsoft DAO Object 3.X Library.  Select the  Tool --> References  menu.

Steve
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
  • 2
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now