How can i make individual print?
i have a problem it prints all the records in database,then
then how can i make a individual print via clicking the item on list box then click the print button?
here's the code
Code:
Private Sub cmdPrint_Click()
Dim rsRep As ADODB.Recordset
Set rsRep = New ADODB.Recordset
rsRep.Open "select * from info", CN ' CN is active connection
Set DataReport1.DataSource = rsRep
DataReport1.Show vbModal
End Sub
please supply my code if there is lacking.
Re: How can i make individual print?
The WHERE clause is used to specify that only certain rows of the table are displayed, based on the criteria described in that WHERE clause. It is most easily understood by looking at an example.
If you wanted to see the EMPLOYEEIDNO's of those making at or over $50,000, use the following:
Code:
SELECT EmployeeIdNo
FROM EmployeeStatisticsTable
WHERE Salary >= 50000;
What I mean is read about WHERE clause
Now, if Your problem is to get an item from the listbox then You can use
Code:
Private Sub List1_Click()
MsgBox List1.List(List1.ListIndex)
End Sub