简体   繁体   English

VB6中的日历报告

[英]Calendar Report in VB6

I'm trying to make a report generating calendar, but I don't want to use the Data Environment because it does not accept a Query with a variable in it (eg SELECT * FROM Sample_tbl WHERE ID_Number = $ID_No) where $ID_No is an Input from a Visual Basic Form, how can I generate a Data Report that when the user clicks on a date on the calendar date picker, it would automatically generate a report showing all the records that matches the date the user had just clicked. 我正在尝试制作一个生成日历的报表,但是我不想使用数据环境,因为它不接受其中带有变量的查询(例如SELECT * FROM Sample_tbl WHERE ID_Number = $ ID_No),其中$ ID_No是Visual Basic表单的输入,如何生成数据报告,当用户单击日历日期选择器上的日期时,它将自动生成一个报告,该报告显示与用户刚刚单击的日期匹配的所有记录。

http://imageshack.com/a/img661/1913/dBALj1.png http://imageshack.com/a/img661/1913/dBALj1.png

You can use the Date_click event for Monthview control.. 您可以将Date_click事件用于Monthview控件。

Private Sub MonthView1_DateClick(ByVal DateClicked As Date)
    ' Call to rs loader
    Call loadRecordset(DateClicked)
End Sub

where loadRecordset sub could be written like: 在哪里loadRecordset子可以这样写:

Private Sub loadRecordset(vDate as Date)
    Dim strQuery as string
    Dim objRs as new ADODB.Recordset

    strQuery = "SELECT *" & _
               " FROM foo" & _
               " WHERE foo.date = '" & vDate & "'"

    'load rs
    objRs.open strQuery, adOpenDynamic, adLockPessimistic

End Sub

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM