sir i want if user click on submit all the records should come form production table if it match dtpicker1 and dtpicker2 value i have
written a code but it is not working kindly let me know.

Private Sub Command1_Click()
 Set rs = New adodb.Recordset
[B]rs.Open "select * from production  where issue_date =  dtpicker1.Value  and dtpicker2.value, con, adOpenDynamic, adLockOptimistic[/B]"
If Not rs.EOF Then
With DataReport3.Sections("section1").Controls
  .Item("text1").DataField = rs.Fields("productname").Name
    End With
    Set DataReport3.DataSource = rs
    DataReport3.Orientation = rptOrientLandscape
    DataReport3.Show
   End If
   End Sub

lolz this

rs.Open "select * from production where issue_date = dtpicker1.Value and dtpicker2.value, con, adOpenDynamic, adLockOptimistic"

i want to see those records on a report which match
with dtpicker1.value as well as dtpicker2.value
that is why i have written.
rs.Open "select * from production where issue_date = dtpicker1.Value and dtpicker2.value, con, adOpenDynamic, adLockOptimistic"

ahihihi even i help you i'm sure you will not mark as solved this. . well thanks. .

how i mark as solve i am still getting runtime error 3709
how should i mark as solved you tell my friend i have written
but it is not working
Private Sub Command1_Click()
Set rs = New adodb.Recordset
'rs.Open "select * from production where issue_date = dtpicker1.Value and dtpicker2.value, con, adOpenDynamic, adLockOptimistic"
rs.Open "select * from production where issue_date = dtpicker1.Value and dtpicker2.value, con, adOpenDynamic, adLockOptimistic"
If Not rs.EOF Then
With DataReport3.Sections("section1").Controls
.Item("text1").DataField = rs.Fields("productname").Name
End With
Set DataReport3.DataSource = rs
DataReport3.Orientation = rptOrientLandscape
DataReport3.Show
End If
End Sub

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.