if ucase(text1.text)="c" or ucase(text1.text)="s" or ucase(text1.text)="sc" then adocdcl.recordsource="select * from"+text1.text else msgbox"该表不存在,请重新输入!", ,"查询" text1.setfoucus exit sub end if adodcl.refresh end sub
改成这样试试? if ucase(text1.text)="c" or _ ucase(text1.text)="s" or _ ucase(text1.text)="sc" _ then adocdcl.recordsource="select * from"+text1.text else msgbox"该表不存在,请重新输入!", ,"查询" text1.setfoucus exit sub end if adodcl.refresh end sub