I have a need to generate a monthly report based on text entered in text boxes on a vb6 form. Right now I am just trying to talor a recordset but eventually I want to enter a date range in two text boxes. This is my code. One text box, one command button, a data control and a Crystal report control. Thanks for any kind of a path forward.
Private Sub Command1_Click()
CrystalReport1.Action = 1
Set ddb = Data1.Database
Set drs = Data1.Recordset
Data1.DatabaseName = "C:\Databases\course_data.mdb"
Data1.RecordsetType = 1 'table type Recordset
Data1.RecordSource = "SELECT * FROM Course " _
& " WHERE CourseID = '" & Text1.Text & "'"
Data1.Refresh
CrystalReport1.Action = 1
End Sub
Private Sub Form_Load()
Screen.MousePointer = 11
Form1.Move Screen.Height \ 2 - Form1.Height \ 2, Screen.Width \ 2 - Form1.Width \ 2
Load Form1
Form1.Show
Screen.MousePointer = 0
End Sub
aspvbwannab
Private Sub Command1_Click()
CrystalReport1.Action = 1
Set ddb = Data1.Database
Set drs = Data1.Recordset
Data1.DatabaseName = "C:\Databases\course_data.mdb"
Data1.RecordsetType = 1 'table type Recordset
Data1.RecordSource = "SELECT * FROM Course " _
& " WHERE CourseID = '" & Text1.Text & "'"
Data1.Refresh
CrystalReport1.Action = 1
End Sub
Private Sub Form_Load()
Screen.MousePointer = 11
Form1.Move Screen.Height \ 2 - Form1.Height \ 2, Screen.Width \ 2 - Form1.Width \ 2
Load Form1
Form1.Show
Screen.MousePointer = 0
End Sub
aspvbwannab