Display a message when a record in my table is not found. MS Access -


i have simple access database put work , idea behind part number entered text box , button click initiates search. if finds record, opens report displays jpg image tied it. if search started box blank prompts user "please enter part number" when record not found type error , have tried has failed. see have no records found message on err_command0_click wrong. new access, please advise. here code:

private sub command0_click() on error goto err_command0_click  if me.text1.value = "" or isnull(me.text1.value)         msgbox "please enter item number."         exit sub         end if  docmd.openreport "imagereport", acviewpreview, , "[itemnumber] =" & "'" & me.[text1].value & "'"  exit_command0_click:     exit sub  err_command0_click:     msgbox "no quality incidents found"     resume exit_command0_click  end sub 

that doesn't sound it's proper record not found error - sounds you're not searching using proper field type.

is itemnumber field numeric?

if try changing open report command eliminate string delimters:

docmd.openreport "imagereport", acviewpreview, , "[itemnumber] =" & me.[text1].value 

Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -