1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Missing Reference

Discussion in 'Software Development' started by BankDev, Jan 16, 2013.

Thread Status:
Not open for further replies.
  1. BankDev

    BankDev Thread Starter

    Joined:
    Jul 13, 2011
    Messages:
    11
    I inherited a database that I think is looking for a missing reference, I get a message stating that the sub or function is not defined. Here is the code (Not sure what Nstr is), can anyone help?:

    Private Sub Form_Current()
    ' Special VineCount Handling (No Longer Needed - 12/2/2004)

    Dim X As Integer, XL As Long
    Dim W As String
    Dim strMsg As String
    Dim Criteria As String
    Dim idsFuncName As String
    Dim FieldCode As String
    Dim RowsWorked As String
    Dim Special As Variant

    idsFuncName = "Time Card Input: FormCurrent"

    ' Not Needed 12/2/2004
    Exit Sub

    FieldCode = Nstr(Me.txtFieldCode)
    RowsWorked = Trim(Nstr(Me.txtRowsWorked))

    ' Any Data
    If Len(FieldCode) = 0 Or Len(RowsWorked) = 0 Then
    Exit Sub
    End If

    ' Special Row Handling
    X = InStr(RowsWorked, "-")
    If X = 0 Then
    Criteria = "[FieldCode] = '" & FieldCode & "'"
    Criteria = Criteria & " AND [Row] = " & RowsWorked
    Special = DLookup("[Special]", "tblFieldDetail", Criteria)
    If Special = "Y" Then
    Me.txtVineCount.Enabled = True
    Me.txtVineCount.Locked = False
    End If
    Else
    Me.txtVineCount.Enabled = False
    Me.txtVineCount.Locked = True
    End If

    End Sub
     
  2. Rollin_Again

    Rollin_Again

    Joined:
    Sep 4, 2003
    Messages:
    4,912
    It seems to me like you are missing a separate function that was created called "Nstr" and the code is trying to pass parameters to the function from the form. The code you provided is attached directly to the form itself and not stored in a stand alone code module. Are there any stand alone code modules associated with this project?


    Rollin
     
  3. BankDev

    BankDev Thread Starter

    Joined:
    Jul 13, 2011
    Messages:
    11
    You were right, when I looked at the modules in design there were three functions that didn't show in my copy of the database. When I added them everything worked fine. Thanks for your help!
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - Solved Missing Reference
  1. snoozee
    Replies:
    0
    Views:
    435
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1085580

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice