Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to find lookup value

Status
Not open for further replies.

Lewy

Technical User
Nov 16, 2001
170
GB
I have a pushbutton with the following code. I am trying to archive a record from a customer database but when I delete the record I need to give a reason for the deletion and the date of the deletion. The code copies across the record into a table with the same structure with the added information but then stops with the error message "unable to find lookup value" and then goes no further, thus not deleting the record from the orginal table. Any help would be most apreciated. Many thanks,
Lewy

var
tcOrig, tcArc Tcursor
F Form
remove String
arcRec Array[] anytype
endvar
edit()
tcOrig.attach(Clients) ; sync TCursor to CUSTOMER pointer

switchmenu

case "Deceased" :tcOrig.Reason="Deceased"
case "Gone Elsewhere" :tcOrig.Reason="Gone Elsewhere"
case "Moved Away" :tcOrig.Reason="Moved Away"
Case "Under Hopsital" :tcOrig.Reason="Under Hospital"

endswitchmenu

if msgQuestion("Confirm", "Delete record?") = "Yes" then
disableDefault

tcOrig.copytoarray(arcRec)
edit()
tcOrig.DateRemoved=today()
view(arcRec)
if tcArc.open("Cust1Archive.db") then
tcArc.edit()
tcArc.insertrecord()
tcArc.copyfromarray(arcRec)
enableDefault ; process DataDeleteRecord now
else
msgStop("Stop!", "Sorry, Can’t archive record.")
endIf
else ; else user didn’t confirm delete
message("Record not deleted.")
endIf
; else form is not in Edit mode
msgStop("Stop!", "Press F9 to edit data.")



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top