I want to shorten my codes coz i got a compile error: procedure too large. is there a way that these thing can be done in shortest code?
this are my sample codes: i have a hundred of this codes, i only pasted 12 to show you.
this are my sample codes: i have a hundred of this codes, i only pasted 12 to show you.
Code:
If Form_List.RecordSource = ("calvelo joseph Query") Then
DoCmd.OpenReport "Clearance", acViewDesign, "calvelo joseph Query"
Reports("Clearance").RecordSource = ("calvelo joseph Query")
DoCmd.OpenReport "Clearance", acViewPreview, "calvelo joseph Query"
Else
If Form_List.RecordSource = ("carpio godofredo Query") Then
DoCmd.OpenReport "Clearance", acViewDesign, "carpio godofredo Query"
Reports("Clearance").RecordSource = ("carpio godofredo Query")
DoCmd.OpenReport "Clearance", acViewPreview, "carpio godofredo Query"
Else
If Form_List.RecordSource = ("caseros roberto Query") Then
DoCmd.OpenReport "Clearance", acViewDesign, "caseros roberto Query"
Reports("Clearance").RecordSource = ("caseros roberto Query")
DoCmd.OpenReport "Clearance", acViewPreview, "caseros roberto Query"
Else
If Form_List.RecordSource = ("celajes artemio Query") Then
DoCmd.OpenReport "Clearance", acViewDesign, "celajes artemio Query"
Reports("Clearance").RecordSource = ("celajes artemio Query")
DoCmd.OpenReport "Clearance", acViewPreview, "celajes artemio Query"
Else
If Form_List.RecordSource = ("coloma lino Query") Then
DoCmd.OpenReport "Clearance", acViewDesign, "coloma lino Query"
Reports("Clearance").RecordSource = ("coloma lino Query")
DoCmd.OpenReport "Clearance", acViewPreview, "coloma lino Query"
Else
If Form_List.RecordSource = ("dayao jose Query") Then
DoCmd.OpenReport "Clearance", acViewDesign, "dayao jose Query"
Reports("Clearance").RecordSource = ("dayao jose Query")
DoCmd.OpenReport "Clearance", acViewPreview, "dayao jose Query"
Else
If Form_List.RecordSource = ("De Guzman josian Query") Then
DoCmd.OpenReport "Clearance", acViewDesign, "De Guzman josian Query"
Reports("Clearance").RecordSource = ("De Guzman josian Query")
DoCmd.OpenReport "Clearance", acViewPreview, "De Guzman josian Query"
Else
If Form_List.RecordSource = ("De Guzman vernadette Query") Then
DoCmd.OpenReport "Clearance", acViewDesign, "De Guzman vernadette Query"
Reports("Clearance").RecordSource = ("De Guzman vernadette Query")
DoCmd.OpenReport "Clearance", acViewPreview, "De Guzman vernadette Query"
Else
If Form_List.RecordSource = ("Dela Cruz helen Query") Then
DoCmd.OpenReport "Clearance", acViewDesign, "Dela Cruz helen Query"
Reports("Clearance").RecordSource = ("Dela Cruz helen Query")
DoCmd.OpenReport "Clearance", acViewPreview, "Dela Cruz helen Query"
Else
If Form_List.RecordSource = ("donsol elvira Query") Then
DoCmd.OpenReport "Clearance", acViewDesign, "donsol elvira Query"
Reports("Clearance").RecordSource = ("donsol elvira Query")
DoCmd.OpenReport "Clearance", acViewPreview, "donsol elvira Query"
Else
If Form_List.RecordSource = ("Dorosan jan christopher Query") Then
DoCmd.OpenReport "Clearance", acViewDesign, "Dorosan jan christopher Query"
Reports("Clearance").RecordSource = ("Dorosan jan christopher Query")
DoCmd.OpenReport "Clearance", acViewPreview, "Dorosan jan christopher Query"
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end sub
Comment