The last function should look something like this in any case:
Public sub viewrecord_dr(byval field as string,byval condition s string)
dim query as string
query = "select from " & tbl
if tbl = nothing then
exit sub
end if
cmd=new sqlcommand (query,con)
dr=cmd.excutereader()
viewrecord_dr=dr
end function
Your code looks like it needs a lot of work though....