ninjaman01
Programmer
Hi Guys Please help!
whenever I try to run my program I always get a "Data Type Mismatch Error" when im adding records to my table.
this is my code:
if thisform.cmdAdd.caption = "ADD"
thisform.txtBrcode.enabled = .T.
thisform.txtDistrict.enabled = .T.
thisform.txtSeqcu.enabled = .T.
thisform.cmdAdd.caption = "SAVE"
thisform.cmdClose.caption = "CANCEL"
thisform.txtBrcode.value = " "
thisform.txtDistrict.value = " "
thisform.txtSeqcu.value = " "
thisform.cmdEdit.enabled = .f.
thisform.cmdDel.enabled = .f.
thisform.cmdSend.enabled = .f.
thisform.Grid1.enabled = .f.
else
if empty(thisform.txtBrcode.value)
m = messagebox("Please provide the branch number.",64,+"Validation")
if empty(thisform.txtDistrict.value)
m = messagebox("Please provide the district.",64,+"Validation")
if empty(thisform.txtSeqcu.value)
m = messagebox("Please provide the seqcus.",64,+"Validation")
return
endif
endif
endif
select brdist
append blank
if .not. found()
replace Bcode with thisform.txtBrcode.value, Branch with allt(thisform.txtDistrict.value), Seqcus with allt(thisform.txtSeqcu.value)
m = messagebox(allt(thisform.txtBrcode.value)+allt(thisform.txtDistrict.value)+allt(thisform.txtSeqcu.value)+" has been added.",64,"System Validation")
else
m = messagebox(allt(thisform.txtBrcode.value)+allt(thisform.txtDistrict.value)+allt(thisform.txtSeqcu.value)+"already exist.",64,"System Validation")
endif
thisform.txtBrcode.enabled = .F.
thisform.txtDistrict.enabled = .F.
thisform.txtSeqcu.enabled = .F.
thisform.cmdAdd.caption = "ADD"
thisform.cmdClose.caption = "CLOSE"
thisform.cmdEdit.enabled = .T.
thisform.cmdDel.enabled = .T.
thisform.cmdSend.enabled = .T.
thisform.Grid1.enabled = .T.
endif
thisform.refresh
whenever I try to run my program I always get a "Data Type Mismatch Error" when im adding records to my table.
this is my code:
if thisform.cmdAdd.caption = "ADD"
thisform.txtBrcode.enabled = .T.
thisform.txtDistrict.enabled = .T.
thisform.txtSeqcu.enabled = .T.
thisform.cmdAdd.caption = "SAVE"
thisform.cmdClose.caption = "CANCEL"
thisform.txtBrcode.value = " "
thisform.txtDistrict.value = " "
thisform.txtSeqcu.value = " "
thisform.cmdEdit.enabled = .f.
thisform.cmdDel.enabled = .f.
thisform.cmdSend.enabled = .f.
thisform.Grid1.enabled = .f.
else
if empty(thisform.txtBrcode.value)
m = messagebox("Please provide the branch number.",64,+"Validation")
if empty(thisform.txtDistrict.value)
m = messagebox("Please provide the district.",64,+"Validation")
if empty(thisform.txtSeqcu.value)
m = messagebox("Please provide the seqcus.",64,+"Validation")
return
endif
endif
endif
select brdist
append blank
if .not. found()
replace Bcode with thisform.txtBrcode.value, Branch with allt(thisform.txtDistrict.value), Seqcus with allt(thisform.txtSeqcu.value)
m = messagebox(allt(thisform.txtBrcode.value)+allt(thisform.txtDistrict.value)+allt(thisform.txtSeqcu.value)+" has been added.",64,"System Validation")
else
m = messagebox(allt(thisform.txtBrcode.value)+allt(thisform.txtDistrict.value)+allt(thisform.txtSeqcu.value)+"already exist.",64,"System Validation")
endif
thisform.txtBrcode.enabled = .F.
thisform.txtDistrict.enabled = .F.
thisform.txtSeqcu.enabled = .F.
thisform.cmdAdd.caption = "ADD"
thisform.cmdClose.caption = "CLOSE"
thisform.cmdEdit.enabled = .T.
thisform.cmdDel.enabled = .T.
thisform.cmdSend.enabled = .T.
thisform.Grid1.enabled = .T.
endif
thisform.refresh