Click here to Skip to main content
15,888,315 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
strSQL = "SELECT * FROM Familyplanningsem_record WHERE Date Encoded BETWEEN " & "'" & DTfrom.Value & "'" & " and " & "'" & dtto.Value & _
"'"

   Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "\Database.mdb;Persist Security Info=False"
    Adodc1.RecordSource = strSQL
    
   Adodc1.Refresh
    Adodc1.Refresh
    
Set familyplanning.DataSource = Adodc1

With familyplanning

    With .Sections("Section1").Controls
        .Item("txtcn").DataField = Adodc1.Recordset.Fields("Control_No").Name
        .Item("txtdate").DataField = Adodc1.Recordset.Fields("Date Encoded").Name
        .Item("txtname1").DataField = Adodc1.Recordset.Fields("Fullname(male)").Name
        .Item("txtage1").DataField = Adodc1.Recordset.Fields("age").Name
        .Item("txtocc1").DataField = Adodc1.Recordset.Fields("Occupation").Name
        .Item("txtadd1").DataField = Adodc1.Recordset.Fields("Address").Name
        .Item("txtname2").DataField = Adodc1.Recordset.Fields("Fullname(female)").Name
        .Item("txtage2").DataField = Adodc1.Recordset.Fields("age1").Name
        .Item("txtocc2").DataField = Adodc1.Recordset.Fields("Occupation1").Name
        .Item("txtadd2").DataField = Adodc1.Recordset.Fields("Address1").Name
        .Item("Label5").Caption = "MUNICIPAL HEALTH OFFICE /AGRICULTURE OFFICE AND SOCIAL WELFARE &"
        .Item("Label6").Caption = "DEVELOPMENT OFFICE"
        
    End With
     With .Sections("Section4").Controls
        .Item("image1").Picture = ImageList1.ListImages(4).Picture
        .Item("image2").Picture = ImageList1.ListImages(1).Picture
        .Item("image3").Picture = ImageList1.ListImages(3).Picture
        .Item("image4").Picture = ImageList1.ListImages(2).Picture
         
    End With
       With .Sections("Section2").Controls
        .Item("Label1").Caption = "Republic of the Philippines"
        .Item("Label2").Caption = "Province of Rizal"
        .Item("Label3").Caption = "MUNICIPALITY OF BINANGONAN"
        .Item("Label4").Caption = "Binangonan,Rizal"
    End With
        .Show
End With
Exit Sub
errhandler:
    MsgBox "Error #: " & Err.Number & vbCrLf & "Description: " & Err.Description, vbExclamation


        
End Sub
Posted
Updated 11-Mar-13 4:16am
v2
Comments
[no name] 11-Mar-13 10:02am    
Please format your code, ask a question and indicate where you are getting the error.
Sandeep Mewara 11-Mar-13 10:56am    
If you really want to get good help, be very accurate in reporting errors. Report the exact error message that is usually pretty informative.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900