Thanx CCINT
Actually I need to pass text from a forms text box & combo box to labels in datareport using command button.
Private Sub cmdretrieve_Click()
On Error Resume Next
DataEnvironment1.rsvaredit.Close
If optbranch.Value = True Then
ssql = "select emp_earnded.*, emp_name from emp_earnded, emp_mast where emp_earnded.emp_code = emp_mast.emp_code and month = " & cbomonth.Text & " and year = " & cboyear.Text & " order by emp_earnded.br_code, emp_earnded.emp_code"
DataEnvironment1.Commands(4).CommandText = ssql
'testing
dtrvaredit.Sections(4).Controls("Label28"

.Caption = "hello"
dtrvaredit.Show
ElseIf optempcode.Value = True Then
ssql = "select emp_earnded.*, emp_name from emp_earnded, emp_mast where emp_earnded.emp_code = emp_mast.emp_code and month = " & cbomonth.Text & " and year = " & cboyear.Text & " order by emp_earnded.emp_code, emp_earnded.br_code"
DataEnvironment1.Commands(4).CommandText = ssql
dtrvaredit.Show
End If