Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > producing access report with vb recordset


Reply
 
Thread Tools Display Modes
  #1  
Old 02-28-2003, 08:11 PM
khanman khanman is offline
Newcomer
 
Join Date: Feb 2003
Posts: 21
Default producing access report with vb recordset


Hi all -- this is my first post so bear with me. I am attempting to produce an access report through vb6. After I populate an ADODB recordset, I want to send it to an access report. The textboxes in the report are all unbound.
I get so far as:
set dbApp = New access.Application

strDB = "c:\SomeDir\SomeDB.mdb"

dbApp.OpenCurrentDatabase strDB ... ... ... then I'm lost.

I try to do: dbApp.DoCmd.OpenReport("SomeReport"), but all that happens is the report is opened for preview with no data (didn't get a chance to set the report to the recordset)

My questions are:
1. Do I need to bind the report in Access to a table (the recordset is a multitable query)
2. How do I set the textboxes in the report to the fields in the recordset

I probably have more questions regarding this matter but I hope the answers to these questions will at least give a good platform to figure the rest (let's hope)

Khanman
Reply With Quote
  #2  
Old 02-28-2003, 09:17 PM
Robby's Avatar
Robby Robby is offline
Code Factory

Retired Moderator
* Expert *
 
Join Date: Jan 2001
Location: Montreal, Ca.
Posts: 5,565
Default

__________________
Visit...Bassic Software
Reply With Quote
  #3  
Old 02-28-2003, 10:24 PM
khanman khanman is offline
Newcomer
 
Join Date: Feb 2003
Posts: 21
Default

Quote:
Originally Posted by Robby
i'm not certain what exactly to put into the criteria...does the "Field1" represent a textbox on the report or a field in the recordset? The report itself is not binded to any table or query; should I bind it?...I was under the impression that I could use a "template" style report object. Also, the Detail portion is a listing of all dependent records associated with an employee.

Robby, I appriciate your assistance and input. Thanks

khanman
Reply With Quote
  #4  
Old 03-01-2003, 06:50 AM
Robby's Avatar
Robby Robby is offline
Code Factory

Retired Moderator
* Expert *
 
Join Date: Jan 2001
Location: Montreal, Ca.
Posts: 5,565
Default

Field1 would be a Field in the recordset, Textbox1 would be a textbox on the VB form.

The critieria can look something like this...

sCriteria = "Field1 = '" & Textbox1 & "' AND Field2 = " & val(textbox2.text)

Field1 one being text based and Field2 being of numeric data type (notice the single quotes surrounding the text based data)

And you need to bind the report to a table or query, you can do it at run-time or design-time... by either puting the table/query name or a full SQL Select statement....

DoCmd.RecordSource = "Select * From myTable"
__________________
Visit...Bassic Software
Reply With Quote
  #5  
Old 03-02-2003, 11:00 PM
khanman khanman is offline
Newcomer
 
Join Date: Feb 2003
Posts: 21
Default

Robby, thank you for the holp, It works like a champ.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
vb and MS access Report kristine Database and Reporting 1 01-25-2003 11:00 AM
print an access report from vb witout access DColes Database and Reporting 3 12-23-2002 11:43 AM
Printing Access Report from VB JerryEng Database and Reporting 3 11-27-2002 01:57 PM
Access Report Design nickg96 Database and Reporting 4 08-19-2002 01:12 PM
QB to VB Conversion - By AIO BillSoo Tutors' Corner 0 08-06-2002 11:37 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->