ms access - about field update using function with case -
i'm trying update field value depending 2 string field using function if , case, function below:
private function checkdati(tipotransazione string, tipovendita string) string dim r string r = "" if tipotransazione = "vendita" select case tipovendita case "armi" if me.txtmatricola = "" r = "matricola" if me.txtmodello = "" r = "modello" if me.txtcalibro = "" r = "calibro" if me.txttipoarma = "" r = "tipo arma" if me.txtfabrica = "" r = "fabbrica" case "vendita armi/munizioni" case "munizioni" end select end if if tipotransazione = "acquisto" select case tipovendita case "armi" if me.txtmatricola = "" r = "matricola" if me.txtmodello = "" r = "modello" if me.txtcalibro = "" r = "calibro" if me.txttipoarma = "" r = "tipo arma" if me.txtfabrica = "" r = "fabbrica" case "vendita armi/munizioni" case "munizioni" end select end if checkdati = r end function and when call function in command button event as:
msgbox (checkdati(me.causalemov, me.txt_tipomov)) it's not updating field. wrong?
when say:
if me.txtmatricola = "" r = "matricola" what doing assigning value: "matricola" variable:r. instead think want this:
if me.txtmatricola = "" me.txtmatricola = "matricola" this sets value of field: txtmatricola "matricola". goes of fields in case statements.
Comments
Post a Comment