Hi all,
What I am trying to do: When I enter my Reception number tcursor will search the table if this number already exists...if no...the user can enter a new record. if yes, I want to search the existing record if there are any blank fields. If there are blank fields, I want to tell the user that they have to edit the record to fill in necessary blanks, otherwise a message says that its a duplicate record.
This is my code:
method changeValue(var eventInfo ValueEvent)
var aa string
tc TCursor
endVar
aa=eventInfo.newValue()
if aa <> self.value then
tc.open("CompSales.db"
if tc.qLocate(aa) and tc."Field Name" = blank() then
beep()
msgInfo("Incomplete Record!", "Edit Record !"
else
beep()
msgInfo("DUPLICATE RECORD!","This Record already exists!"
disableDefault
eventinfo.setErrorCode(CanNotDepart)
endif
endif
endif
endMethod
Any help is greatly appreciated! I am SO frustrated because I cant figure it out!!
Margot
What I am trying to do: When I enter my Reception number tcursor will search the table if this number already exists...if no...the user can enter a new record. if yes, I want to search the existing record if there are any blank fields. If there are blank fields, I want to tell the user that they have to edit the record to fill in necessary blanks, otherwise a message says that its a duplicate record.
This is my code:
method changeValue(var eventInfo ValueEvent)
var aa string
tc TCursor
endVar
aa=eventInfo.newValue()
if aa <> self.value then
tc.open("CompSales.db"
if tc.qLocate(aa) and tc."Field Name" = blank() then
beep()
msgInfo("Incomplete Record!", "Edit Record !"
else
beep()
msgInfo("DUPLICATE RECORD!","This Record already exists!"
disableDefault
eventinfo.setErrorCode(CanNotDepart)
endif
endif
endif
endMethod
Any help is greatly appreciated! I am SO frustrated because I cant figure it out!!
Margot