Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CNUM --what is it? 1

Status
Not open for further replies.

TadyB

Programmer
May 21, 2004
42
0
0
US
Hey everyone!
I'm learning VBA and run into a problem. Someone gave me an Access database to use to learn from and it has CNUM in it and I'm getting an error when it calles on it. It says "Sub or function not defined"...CNUM is highlighted when I go to debug. I check everything else and it seems right. I can't find CNUM in Access' help. What does it do and am I missing a reference or something?

Thank you,
Stacey
 
How are ya TadyB . . . .

According to the error message,CNUM is a VBA routine that doesn't exist in the database. So . . . no . . . ya wont find it in help.

Out of curiosity, post the calling line.

Calvin.gif
See Ya! . . . . . .
 
Hey...thanks for the reply!

I'm searching to find if CNUM was defined somewhere else in the coding that I might have deleted...going back to the original.

The line with CNUM in it is:
sngReorderPt = cnum(strReorderPt)/100

I searched for CNUM in this forum and it seems to be used to return a number or something??

Thanks again,
Stacey
 
Hey Richard! How have you been???

This problem comes from the swim database when you go into the ItemFrm and try to select from the Reorder dropdown.

Any ideas?

Thanks,
Stacey
 
Stacey

I am fine - thanks

What is the error?
The re-order point is something you may or may not want to use. If not using it, you can delete the code and delete the fields so not to encounter the problem.

I will check the code, and get back to you....
 
Stacey

This code was incomplete. It was to find inventory that needed to be re-ordered. Here is a fix...

Code:
Private Sub ReOrderPtQry_AfterUpdate()

Dim strReorderPt As String, sngReorderPt As Single
Dim strQ As String, strSQL As String

If Len(Nz(ReOrderPtQry)) > 0 Then
    strReorderPt = ReOrderPtQry.Column(1)
    sngReorderPt = CSng(strReorderPt) / 100
    strReorderPt = ReOrderPtQry
    
    strQ = Chr$(34)
    strSQL = "Select * from stItemTbl where (ReOrderPt / ItemOnHand <= " & sngReorderPt _
    & " and ReOrderPt > 0 and ItemOnHand > 0 ) or ItemOnHand = 0"
    
    Me.Form.RecordSource = strSQL
    Me.Form.Requery
    
End If

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top