Solved: Missing Reference

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

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
 
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
 

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!
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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 807,865 other people just like you!

Latest posts

Staff online

Top