Changing Object Properties.

ConfusedA

Registered User.
Local time
Today, 10:57
Joined
Jun 15, 2009
Messages
101
I have a button that runs an append query, my concern is that I only want to run the query a maximum of one time per record, each time a new record is input I would like the query to append so that a value can be added to my 2 tables. In order to do this I decided to start the button as
Enabled: No

What I would like to do is have the button only enabled after there has been changes to the text box that contains the field that will be added to both tables.

In the properties of that text box I have attempted to create the event
On Lost Focus: = cmdappend.Enabled

(which was the syntax provided when i clicked the '...' and used Expression Builder. This does not work, I was wondering if there was a problem with syntax or if this is possible.

Thanks.
ConfusedA
 
What about on the after update event of your text box?
 
The fact that a change to a field in one table necessitates a change to a field in a different table is exactly the kind of data dependency that you use a relational database system to avoid.
If you have two locations to store the same data you necessarily introduce the possibility that they will not agree, and create the make-work situation that changes to one require that the other be changed.

Almost always...
...Retrieve data from it's authoritative source when it is consumed.
Almost never...
...store the same data in many places when data is produced.
 
The fact that a change to a field in one table necessitates a change to a field in a different table is exactly the kind of data dependency that you use a relational database system to avoid.
If you have two locations to store the same data you necessarily introduce the possibility that they will not agree, and create the make-work situation that changes to one require that the other be changed.
And until Access 2010 is released you should not really do this because in all previous versions Access does not have triggers. I would argue, just like lagbolt says, that you should not store the same data in multiple places, even if you do get access to data macros in the next version of Access.
 
Thank you for your response, I do agree that storing the data in 2 different tables is problematic but I cannot think of any other way to accomplish what I require.

My problem is that the data is stored in a secure location (due to wages) and 1 piece of data (employeename) needs to be used to populate the list boxes that require it. Under the current circumstances the employee names do not appear in the list box when the basic user does not have access to the full table, if theres a better way to be able to reveal that data than creating another table I'd love to know. But I cannot think of a way to make just that field available while all the other data must remain confidential, and I cannot manually change the list box data because that would defeat the whole purpose of having the ability to update the employee list. Is there a better way to do this?

Thanks again.
A
 
My problem is that the data is stored in a secure location (due to wages) and 1 piece of data (employeename) needs to be used to populate the list boxes that require it. Under the current circumstances the employee names do not appear in the list box when the basic user does not have access to the full table, if theres a better way to be able to reveal that data than creating another table I'd love to know. But I cannot think of a way to make just that field available while all the other data must remain confidential, and I cannot manually change the list box data because that would defeat the whole purpose of having the ability to update the employee list. Is there a better way to do this?

I believe this thread has come around to your other post.

http://www.access-programmers.co.uk/forums/showthread.php?t=176463

I'll post a couple of thoughts in this other thread.
 
Last edited:
Well, I sorted the security and multiple data location problem. Thanks all for the advice on that. But I still have a problem that requires shutting off a form and button.
There is a bunch of data that I do not want to be changed in a table(that has records viewable because it's connected to a form), but it will require people to input new data into the form. What I would like to do is block access to previous records in a form (it always opens up as the next record, but I cannot figure out how to make it incapable of returning to previous records). Also I would like to be able to enable/disable a button based on certain responses in fields. (well, disable the button on certain responses and enable it on the next new record).

Is any of this possible? If so, could you please direct me towards some reading material or suggestions on how to go about doing this?

Thanks.
ConfusedA
 

Users who are viewing this thread

Back
Top Bottom