Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 22nd, 2004, 08:04 AM
Registered User
 
Join Date: Jun 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error 20515 when run CR9 from Vb6 and Access2000

I have code as below:

Dim strEnterMon As String
 strEnter = InputBox("Enter the month and the year of the leave anniversary date", "Please Enter The MM/YYYY Formart", "02/2004")
 If Len(strEnter) <> 0 Then
    strEnterMon = Format(strEnter, "mm/yyyy")
    Dim drs1 As Recordset
    Set drs1 = db.OpenRecordset("SELECT LName, FName, MI, LeaveAnnDate, SSN, Locator, EmplTime FROM Employee WHERE Year(LeaveAnnDate) = Cint('" & Mid(strEnterMon, 4, 4) & "') and Month (LeaveAnnDate) = Cint('" & Mid(strEnterMon, 1, 2) & "');")
    If drs1.RecordCount <> 0 Then
      MousePointer = 11
      CryReport.ReportFileName = App.Path & "/LeaveAnnMon.rpt"
      CryReport.WindowTitle = "Employee leave anniversary Date By leave anniversary Month and leave anniversary Year"
      CryReport.Formulas(0) = "ReportTitle = 'EMPLOYEE LEAVE ANNIVERSARY FOR " & strEnter & "'"
      CryReport.Formulas(1) = "Yea = '" & Mid(strEnterMon, 4, 4) & "'"
      CryReport.Formulas(2) = "Mon = '" & Mid(strEnterMon, 1, 2) & "'"
      CryReport.WindowState = 2
      CryReport.SelectionFormula = "{@LeaveAnnyear}= ToNumber({@Yea}) and {@LeaveAnnmon}= ToNumber({@Mon}) and {qryEmp.Status}='ACTIVE'"
      CryReport.Action = 1
      MousePointer = 1
   Else
      MsgBox "No employee matching the year and the month of the leave anniversary date!"
      Exit Sub
   End If
There are no problem with VB5 and CR7. What changes should be made in VB6. I'm using Access 2000.


Thanks for any help.







Similar Threads
Thread Thread Starter Forum Replies Last Post
Vb6 - CR9 (CRViewer91.Refresh) P00rS41nt VB How-To 0 November 23rd, 2005 02:37 AM
VB6 App with CR9 problem ioates Pro VB Databases 0 May 10th, 2005 10:37 AM
Run access or SQL from VB6 fgrobbelaar VB Databases Basics 1 February 16th, 2005 04:50 PM
DAO Run Time Error 3423 - VB6 to Access2000 Iblys Access 1 September 25th, 2003 09:31 PM
access2000 and vb6.0 cydel VB How-To 1 September 5th, 2003 04:20 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.