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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

procedur Overflow Error?!?!?!? 1

Status
Not open for further replies.

kermitforney

Technical User
Mar 15, 2005
374
US
I am getting an error message in my VBA somewhere,
"Error in module frmVendorItems in procedure Form_Current Overflow"

Code:
Private Sub Form_Current()
    Const kstrProcName As String = "Form_Current"

    On Error GoTo TRAP

    UpdateNoteCmd Me.Name
   
    
    'Make the combo boxes visible if new record, otherwise the text boxes.
    'This is because I couldn't figure out how to get Access searching
    'to work properly on a combo box.
    lblcboItemID.Visible = Me.NewRecord
    lblcboCommID.Visible = Me.NewRecord
    cbolngVendorID.Visible = Me.NewRecord
    cbolngItemID.Visible = Me.NewRecord
    lbltxtItemID.Visible = Not Me.NewRecord
    lbltxtCommID.Visible = Not Me.NewRecord
    txtCommName.Visible = Not Me.NewRecord
    txtItemDesc.Visible = Not Me.NewRecord
     
'The each cost is not stored in the DB, rather it is calculated and
'displayed on this form
    If (Not Me.NewRecord) Then
        Dim strEachCost As String
        strEachCost = CStr(Round(Me.monBaseCaseCost / Me.intItemsPerCase, 4))
        txtEachCost.Value = "$" + strEachCost
    Else
        txtEachCost.Value = "$0.00"
    End If
      
    
CLEANUP:
    Exit Sub

TRAP:
    MsgBox "Error in module " & kstrModuleName & vbCrLf _
            & "in procedure " & kstrProcName & vbCrLf _
            & Err.Description, vbCritical
    Resume CLEANUP
    
End Sub
 
Comment out the On Error instruction and then show us the highlighted line when in debug mode.

BTW, I'd test that Me.intItemsPerCase is not = 0 !

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 

I'd try commenting out this line:

Const kstrProcName As String = "Form_Current"


and seeing if that helps. It may be confusing Access.

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Thanks, PHV!! I thought that might be the culprit so I did a lil research and found a SQL trigger that wasn't allowing an update to intItemsPerCase in the backend. So, long story short it was a 0. :eek:)

Thanks again, PHV!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top