Source language: Translate to:

Protecting field from accidental change

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Protecting field from accidental change

Postby BRobinsonS » Mon Jan 09, 2017 6:42 pm

I have a membership database application with MemNo (member number) field string(12).
The Only Text Entry Field is Disabled (not Enabled) which uses MemNo of database field.
In theory the only way to changed the MemNo value is through a routine which I developed to Change from a Temporary member number to permanent member number.
Which updates the dues payment table as well.

However, every once and a while I see the MemNo value is blank or altered from what it should be.
Somehow the MemNo value is changed accidentally when entering another value for different field possibly on another screen.

Is there a way to test that the MemNo field is being altered and alert the user that this is happening?
Other displays of the MemNo is in a simple text label.
Doesn't happen all the time but once in a while.

Thoughts? Solutions?
Brian Robinson
'When all else fails, try again!'
www.ComputerSoftwareSystems.com
User avatar
BRobinsonS
 
Posts: 340
Joined: Sun Sep 25, 2005 9:00 pm
Location: Ontario, Canada

Re: Protecting field from accidental change

Postby virger » Tue Jan 10, 2017 8:17 am

Try yjis:
Code: Select all
dbpSetFieldProperties "Base" "Table" "Field" "ReadOnly=Yes"


dbpSetFieldProperties "Base" "Table" "Field" "ReadOnly=Yes"
COSTA RICA
PURA VIDA
User avatar
virger
 
Posts: 524
Joined: Mon Sep 18, 2006 12:21 pm
Location: Costa Rica, America Central

Re: Protecting field from accidental change

Postby BRobinsonS » Tue Jan 10, 2017 8:37 am

ReadOnly seems to refer to Grid. Would it apply to a Text Field too?

Also, to make a change from Temp MemNo to Permanent MemNo, would I have to use dbpSetFieldProperties "Base" "Table" "Field" "ReadOnly=No"
Then back to dbpSetFieldProperties "Base" "Table" "Field" "ReadOnly=Yes" after the edit?
Brian Robinson
'When all else fails, try again!'
www.ComputerSoftwareSystems.com
User avatar
BRobinsonS
 
Posts: 340
Joined: Sun Sep 25, 2005 9:00 pm
Location: Ontario, Canada

Re: Protecting field from accidental change

Postby BRobinsonS » Sat Oct 28, 2017 11:45 am

Still a mystery to me.
MemNum Field on form is Disabled so change would not be made by accident.

Only MemNum field is a text field disabled with other MemNum values displayed by Simple Text (not editable).

There is a Change MemNum used to change a MemNum from Temporary Number to Permanent Number.
Not used after Member has a permanent MemNum.

I do you this routine to correct the error when MemNum gets changed.

Any thoughts ?
Brian Robinson
'When all else fails, try again!'
www.ComputerSoftwareSystems.com
User avatar
BRobinsonS
 
Posts: 340
Joined: Sun Sep 25, 2005 9:00 pm
Location: Ontario, Canada

Re: Protecting field from accidental change

Postby Gaev » Sat Oct 28, 2017 1:57 pm

Brian:

From the Help file ...
dbpOpenTable "database id" "table" "subroutine"

database id
The name assigned to the database containing the table you want to open.

table
The name of the table you wish to open.

subroutine
The name of a subroutine from your publication's Subroutine Action. The subroutine specified here will be automatically executed whenever the table is updated or the current record number changes.

... so you can check for any unexpected changes within such a Subroutine.
User avatar
Gaev
 
Posts: 3738
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Protecting field from accidental change

Postby BRobinsonS » Sun Nov 05, 2017 2:02 pm

Might need some help with this one.
I understand about the subroutine.

How do I focus on the MemNum field in the subroutine to see if it is being changed (i.e. by accident) ?
I would then prompt "Sure you want to change this field? "
Brian Robinson
'When all else fails, try again!'
www.ComputerSoftwareSystems.com
User avatar
BRobinsonS
 
Posts: 340
Joined: Sun Sep 25, 2005 9:00 pm
Location: Ontario, Canada

Re: Protecting field from accidental change

Postby Gaev » Sun Nov 05, 2017 3:54 pm

Brian:

I suggest that you first set this subroutine to just report found values for database field called MemNo e.g. ...
Code: Select all
AlertBox "Update Subroutine says" "[myDB.myTable.MemNo]"


Then study what is being reported as you navigate from record to record ... and when you add/change/delete a record.

Armed withis knowledge, you will be able to design a script (for this subroutine) that captures the "before value" (in a non-database variable) and compares it when the record is updated ... if different (or null) you can then report it to user.
User avatar
Gaev
 
Posts: 3738
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Protecting field from accidental change

Postby BRobinsonS » Sun Nov 05, 2017 4:15 pm

Thanks I will work on the idea.
Brian Robinson
'When all else fails, try again!'
www.ComputerSoftwareSystems.com
User avatar
BRobinsonS
 
Posts: 340
Joined: Sun Sep 25, 2005 9:00 pm
Location: Ontario, Canada


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 2 guests