Suppress Error Messages in Access -
i have access form runs query. runs query using vba code , searches table text fields , number fields depending on field choose on combo box in form.
i have left note if wish search text field must enter double quotes or code not work. however, if user not follow these directions popup exlains coding issue options debug , end. not want them see message.
is there way suppress error message , write own?
edit: dim dbscurrent database dim qrytest querydef
varwhere = "where inclusiveparent." & combo0.value & "=" & text2 varwhere = "select location, icmservice, icmscript, thresholdvariable, pbxvdn, domestic, firstsecondlook, dnis, tollfree, outdial, description, carrier, defaulttollfree, blockedroute, variable3, variable4, variable5, variable9, valuescrvdn, cvp inclusiveparent " & varwhere 'filter frmcustomers based on search criteria 'dim dbscurrent database 'dim qrytest querydef set dbscurrent = currentdb set qrytest = dbscurrent.querydefs("broaden") qrytest.sql = varwhere 'close frmsearch docmd.close acform, "searchdependents"
inclusiveparent query i'm requery-ing , broaden requery. searchdependents name of form. combo0 combo box lets them select field choose filter. , text2 text field enter filter criteria in. however, not fields numbers, when choose filter text field must enter double quotes or code fails.
try , remove note require quotation marks:
varwhere = "where inclusiveparent." & combo0.value & "=" if isnumeric(text2.value) varwhere = varwhere & text2.value else varwhere = varwhere & """" & text2.value & """" end if
Comments
Post a Comment