I am using five data report in my project Structure of all the report are same but their image and font and some default field are different.
When I running them into my project there is need of write them five time into the project……but if there field structure are same then why we write them five time.
Any possibility that if we write them one time and use it accordingly to related
Report

Any idea..........................

my coding not working.................

VB Code:
  1. If ComCollege.Text = "GION" Then
  2. Call Test("Report_Receipt")
  3. End If
  4.  
  5. If ComCollege.Text = "UIPPS" Then
  6. Call Test("Report_Uiipp_Receipt")
  7. End If
  8.  
  9. If ComCollege.Text = "AION" Then
  10. Call Test("Repost_Arawali_Receipt")
  11. End If
  12.  
  13.  
  14.  
  15.  
  16. Private Sub Test(Repo As String)
  17. On Error GoTo ErrorTrap
  18.  
  19. Dim FEE
  20. If RECEIPT1 = 0 Then
  21. MsgBox "Hostel Receipt Not Possible" + Chr(13) + "1)May Be Record Not Saved By You!" + Chr(13) + "2)May Be Hostel Fee Not Deposited!", vbInformation, "First Save The Record..."
  22. Exit Sub
  23. End If
  24. TSQL = ""
  25. TSQL = "SELECT * FROM RECEIPT WHERE COLLEGE='" & ComCollege.Text & "' AND CLASS='" & ComClass.Text & "' AND E_NO='" & TXTSE_NO.Text & "' AND R_NO=" & RECEIPT1 & ""
  26. Set RTMP = Get_Special_Record_Set(TSQL)
  27. If RTMP.RecordCount = 0 Then
  28. MsgBox "Record Not Found", vbInformation, "Incorect Information..."
  29. Exit Sub
  30. End If
  31. FEE = "HOSTEL FEE"
  32.  
  33. With Repo
  34.  
  35.     Set .DataSource = Nothing
  36.    Set .DataSource = RTMP.DataSource
  37.  
  38.  
  39. While Not RTMP.EOF
  40. With Repo.Sections("Section1").Controls
  41.    
  42.     .Item("txtDATE").DataMember = ""
  43.     .Item("txtDATE").DataField = RTMP.Fields("DATE").Name
  44.    
  45.     .Item("txtSNO").DataMember = ""
  46.     .Item("txtSNO").DataField = RTMP.Fields("R_NO").Name
  47.    
  48.     .Item("txtNAME").DataMember = ""
  49.     .Item("txtNAME").DataField = RTMP.Fields("NAME").Name
  50.    
  51.     .Item("txtBATCH").DataMember = ""
  52.     .Item("txtBATCH").DataField = RTMP.Fields("BATCH").Name
  53.    
  54.     .Item("txtCLASS").DataMember = ""
  55.     .Item("txtCLASS").DataField = RTMP.Fields("CLASS").Name
  56.    
  57.     .Item("txtAMOUNT").DataMember = ""
  58.     .Item("txtAMOUNT").DataField = RTMP.Fields("HOSTAL").Name
  59.    
  60.  
  61.     RTMP.MoveNext
  62. End With
  63. Wend
  64.  
  65. Repo.Refresh
  66.  
  67. Repo.Show
  68.  
  69. RECEIPT1 = 0
  70.  
  71. ErrorTrap:
  72. If Err.Number <> 0 Then
  73.    MsgBox "Error (" & Err.Number & "): " & Err.Description, vbCritical, "Error"
  74. End If
  75. End Sub
  76.  
  77.  
  78. If ComCollege.Text = "SEION" Then
  79. Call Test("Report_Shrinath_Receipt")
  80. End If
  81.  
  82. If ComCollege.Text = "MBNC" Then
  83. Call Test("Report_Mass_Receipt")
  84. End If

help.............