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?
Protecting field from accidental change
Moderator: Neosoft Support
- BRobinsonS
- Posts: 355
- Joined: Sun Sep 25, 2005 9:00 pm
- Location: Ontario, Canada
- Contact:
Re: Protecting field from accidental change
Try yjis:
dbpSetFieldProperties "Base" "Table" "Field" "ReadOnly=Yes"
Code: Select all
dbpSetFieldProperties "Base" "Table" "Field" "ReadOnly=Yes"
COSTA RICA
PURA VIDA
PURA VIDA
- BRobinsonS
- Posts: 355
- Joined: Sun Sep 25, 2005 9:00 pm
- Location: Ontario, Canada
- Contact:
Re: Protecting field from accidental change
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?
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?
- BRobinsonS
- Posts: 355
- Joined: Sun Sep 25, 2005 9:00 pm
- Location: Ontario, Canada
- Contact:
Re: Protecting field from accidental change
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 ?
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 ?
Re: Protecting field from accidental change
Brian:
From the Help file ...
From the Help file ...
... so you can check for any unexpected changes within such a Subroutine.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.
- BRobinsonS
- Posts: 355
- Joined: Sun Sep 25, 2005 9:00 pm
- Location: Ontario, Canada
- Contact:
Re: Protecting field from accidental change
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? "
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? "
Re: Protecting field from accidental change
Brian:
I suggest that you first set this subroutine to just report found values for database field called MemNo e.g. ...
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.
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]"
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.
- BRobinsonS
- Posts: 355
- Joined: Sun Sep 25, 2005 9:00 pm
- Location: Ontario, Canada
- Contact:
Re: Protecting field from accidental change
Thanks I will work on the idea.