All,
I am trying to be more efficient with my code by using global modules.
What I want to do is....
I have a form where there are approx 6 text boxes. 5 of them have a tag value of 1 the other text box has a tag value of 6.
When the form moves from one record to another, tag 1's become
locked =true
enabled = false
tag 2 becomes locked = true
default for enabled = true so that user can read and scroll
I have a button which allows edits.
When the button is pressed it enables all tag 1's and tag 2
and locked becomes false on all of them.
It all works fine, but what I want to do is.
Keep the enabling = false and locking of the text boxes when the form moves from record to record.
the change i want to make is that if the user clicks on the edit button it allows edits and then if the user clicks on it again then it disables the edits, I'm sure I could use a toggle button, button I just want to use a command button, with code behind it which makes a module call which will first check if the tag '1 are enabled = true and locked = false
the code in the module needs to
check enabled status of A text box with property tag = 1
if it is enabled = false then it returns a boolean of false
else true.
The code behind the button would call the module, get the result of false and then allow edits otherwise it would get the result of false and disable edits.
The problem is that when I am using a global Module I cant really say something like me.txtXX, it really needs to be able to find a txt box which has a tag value of 1 and then check its enabled state, before passing the boolean to the form.
To summarise, this one command button when clicked works both to allow edits or disables them.
Hope this makes sense n hope you can help.
Idd
I am trying to be more efficient with my code by using global modules.
What I want to do is....
I have a form where there are approx 6 text boxes. 5 of them have a tag value of 1 the other text box has a tag value of 6.
When the form moves from one record to another, tag 1's become
locked =true
enabled = false
tag 2 becomes locked = true
default for enabled = true so that user can read and scroll
I have a button which allows edits.
When the button is pressed it enables all tag 1's and tag 2
and locked becomes false on all of them.
It all works fine, but what I want to do is.
Keep the enabling = false and locking of the text boxes when the form moves from record to record.
the change i want to make is that if the user clicks on the edit button it allows edits and then if the user clicks on it again then it disables the edits, I'm sure I could use a toggle button, button I just want to use a command button, with code behind it which makes a module call which will first check if the tag '1 are enabled = true and locked = false
the code in the module needs to
check enabled status of A text box with property tag = 1
if it is enabled = false then it returns a boolean of false
else true.
The code behind the button would call the module, get the result of false and then allow edits otherwise it would get the result of false and disable edits.
The problem is that when I am using a global Module I cant really say something like me.txtXX, it really needs to be able to find a txt box which has a tag value of 1 and then check its enabled state, before passing the boolean to the form.
To summarise, this one command button when clicked works both to allow edits or disables them.
Hope this makes sense n hope you can help.
Idd