borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (select statements)Next Topic (Getting ) New Topic New Poll Post Reply
AndreaVB Forum : Database : VB6 => Access2000, Passing 2 Parameters?
Poster Message
Humbermaniac
Level: Guest


icon VB6 => Access2000, Passing 2 Parameters?  Archived to Disk

Hi,  I'm trying to print an access2000 Report from VB6, and need to pass 2 parameters - a start date and an end date.  Here is my code (which doesn't work:
  
intResponse = MsgBox("Are you sure you want to print this Report?", vbYesNo, "Print Horticulture Income Report?" )
    If intResponse = vbYes Then
                
        DatabaseName = App.Path + "Millwood4.mdb"
        AppAccess.OpenCurrentDatabase (DatabaseName)
        
        AppAccess.DoCmd.OpenReport "repHortiIncome", acViewNormal, , _
            "[Start]= " & dtpStart.Value & "AND [End]= " & dtpEnd.Value
                    
        AppAccess.CloseCurrentDatabase
        Set AppAccess = Nothing
        Screen.MousePointer = vbDefault
End If

T^hem 2 parameters (Start , End) are in the underlying query on which the Report is based.
Any help would be much appreciated....I know it must be close!

Thanks

05-08-2002 at 10:50 PM
| Quote Reply
sunflower
Level: Guest

icon Re: VB6 => Access2000, Passing 2 Parameters?  Archived to Disk

Hi,
The way that I've been able to send data is with the following code:

dim accessRecordset as adodb.recordset
set accessRecordset = new adodb.recordset

accessRecordset.Open "tablename"

accessRecordset!start = startDate
accessRecordset!end = endDate

I'm not sure if this code is what you would be looking for.  This assumes that the fields start & end already exist in the database you're connecting to.  Hope this helps.  

06-08-2002 at 12:09 PM
| Quote Reply
AndreaVB Forum : Database : VB6 => Access2000, Passing 2 Parameters?
Previous Topic (select statements)Next Topic (Getting ) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder