First of all, hi all Second, I'm quite a newbie, so I hope I'm not asking too simple questions. Now, lets get down to business

I'm using VB6.0 pro and microsoft access with access 97 file format. What I want is when I click the button "Print" to open the report, give it the parametre lying in text1.text and print it. So far, I've found some tuts around the internet but the best I've gotten to is be asked to manually enter the parametre and get printed the record whose parametre I've written. Here's the code for my Print button:

Code:
Set objaccess = CreateObject("Access.Application")
With objaccess
        
        .OpenCurrentDatabase filepath:="c:\db1.mdb"
        .DoCmd.OpenReport "queryname", acPreview, "[id] = " & text1.text


            .Visible = True

            '.DoCmd.Maximize 'maximizes the Report window

            '.DoCmd.Maximize 'maximizes Access window
End With
Where id is the name of my index in the access database and text1.text is the name of the control whose value I want to get. With this code, I get asked for the id and the report with the record with that id is printed. What I want is NOT to be asked to manually enter the id, but rather the id to be passed automatically from text1.text. Any help?