can anyone help me?..i trying to make a very flexible report according to a search Results...i use vb6 and ms access as database...

Doesn't access have the ability to generate reports? Is there a reason why you can't use it?

If your stranded in 1998 and need to use VB6, you could generate html or latex.

Another option would be to upgrade to something that belongs to this decade where you'll have more options.

hiroshe..my situation is quite complicated i will attach 4 photos in this comment to let u see my current problem..i am really f*cked up...

Hi mcdczzz, I'm not saying that I can help but what have you provided anyone here in order to help you. All you've asked for is making a dynamic report according to search results. If you've done any coding for yourself, you would know that requirements need to be very specific and what you are asking for is so vague, it almost doesn't warrant answering (which is probably why there hasn't been many responses).

Be very specific, provide code that you've already done or have, attach the pictures you said you would attach, and then someone should be able to help you.

here is my code for printing my data report

Public Function PrintReport(BID As Integer, myreport As MyDE)
If myreport.rsReportSQL_Grouping.State = 1 Then myreport.rsReportSQL_Grouping.Close

myreport.ReportSQL_Grouping BID

FlexibleReport.Show

End Function

but only selected items in the table is needed to be printed so do i still need to make sql for this?..i having this error with my current code above..

Failed Getting Rowset(s) from current Data source

Attachments Search_by_Month.jpg 153.09 KB Database_Structure.jpg 117.34 KB Search_by_Business_Name_1.jpg 130.76 KB Search_by_Business_Name_2.jpg 127.02 KB Date_Report_Outline.jpg 162.99 KB Search_by_Applicant_Name_2.jpg 128.82 KB

Not enough information to help your specific problem.

If you want to generate a report based on search results, then yes, you'll need to make an SQL query that gets the search results.

im not sure if i am making this correctly but if you know how to do it then please just give some patterns or hints...

You mean the SQL? I have no idea what your table looks like. A blind shot in the dark would be:

"SELECT * FROM applicants WHERE name LIKE '%" + name + "%';"

I'm not sure how your code works given that we're missing the definition of MyDE and FlexibleReport (I don't beleive these are a part of VB or ms Access if I'm not mistaken).

Edited 2 Years Ago by Hiroshe

hiroshe..i somehow made a step..i can generate report now for table but i need a specific record to be generated..

Private Sub getcellvalue()
Dim getcellvalue As Integer
Dim ctr As Integer

    With grdResults
        For ctr = 1 To .Rows - 1
            .Row = ctr
            .Col = 1
                getcellvalue = CInt(.Text)
        SQL = "SELECT BID, `Date`, `Time`, OwnerName, BusinessName, BusinessAddress, Capital, Workers, Classification, CertificateNumber,ORNo, Amount, DateIssued, EffectiveDate, ReleaseDate, ReleaseTime,ProcessingTime From BusinessInformation WHERE BID = " & BIDs & " "
        FlexibleReport.Show
        Next

    End With

End Sub

this is the code what i use for now..but i dont know if i would get correct results because i get this error
Parameter ?_1 has no default value

i already fix all the problem but still one new prob appeared..data report is now showing all details but only one detail..it can show correct detail if my flexgrid items is only one then i tried two thats how i know i should loop the details to put all flexgrid items in data report..

Public Function PrintReport(BID As Integer, DE As myde, grd As MSFlexGrid)

If DE.rsReport_Grouping.State = 1 Then DE.rsReport_Grouping.Close
FlexibleReport.Orientation = rptOrientLandscape
Dim BIDs As Integer
Dim ctr As Integer

    With grd
        For ctr = 1 To .Rows - 1
            .Row = ctr
            .Col = 1
            BIDs = CInt(.Text)
    Next
    End With
DE.Report_Grouping (BIDs)
FlexibleReport.Show

End Function

here is the code what i use for now..the item it displays in data report is the last on the list only..

I'm not an expert at VB, but it looks like you're overwriting the same values over and over again, given you only the last result.

I think you'll find the example here usefull.

This article has been dead for over six months. Start a new discussion instead.