By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,960 Members | 1,563 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,960 IT Pros & Developers. It's quick & easy.

How to change characteristic of a field in a specific line of a continuous mode form

P: 2
Microsoft Office 2010
Version 14.0.7116.5000

Let's say I have a table with two fields:
Txt1 - Data Type:Text
Txt2 - Data Type:Text
Just as an example I could have the following contente in this table:
Txt1 Txt2
ABC LOCK
DEF UNLOCK
GHI LOCK
JKL LOCK

What if I construct a form using this table that must be showed in the continuous form mode. So I would have 4 lines in the presented form.

The question is: How can I change a specific característic of the field showed in the form according to the content of the field Txt2.
Let's say that in the lines which Txt2's content is LOCK, I want the field Txt1 to be locked, but where Txt2's content is UNLOCK I want the field Txt1 to be unlocked.

Is it possible to do that?
Normaly when I try to change the property .LOCK in a field like this, I'm changing that característic in all lines.
Was wondering if could somebody help me.

Best Regards
Ricardo de Milano
Jun 3 '14 #1
Share this Question
Share on Google+
6 Replies


Expert 100+
P: 1,240
Use the form's OnCurrent event. Since the Lock/Unlock property only matters when the user is positioned on a particular row that should work well. Just put some If/then logic in the OnCurrent event to set the lock/unlock property for each textbox.

Jim
Jun 3 '14 #2

NeoPa
Expert Mod 15k+
P: 31,769
See Why Values in Unbound Form Controls do not Persist for why it's impossible (and makes no sense even) to set properties for a form control on a per-record basis.

That said (and hopefully understood), it isn't always necessary to set it for each record separately as only the current record can be affected by many of the properties.

Jim's post gives further details of how you may take advantage of this.
Jun 4 '14 #3

P: 2
Thank you guys... I think I got it.
But I'd like to state that there are some situations where it would be interesting to change the properties of a form control on a per-record basis.
Let's supose I'd like to show these records with a transparent back style whenever the other content's field is "LOCK". The question is that in spite of having interaction just with the record that is current, the other records can also be seen at the same time. So, I guess that would be interesting to be able to change that property.
But, maybe a good way to solve the situation would be to let it be Always transparent and have a text behind the field that could have a conditional color or something like that.

Any way...
Thank you very much for helping.
I think the question can be considered as solved.
Best Regards
Ricardo de Milano
Jun 4 '14 #4

Expert 100+
P: 1,240
Very glad you worked it out. Good job.

Conditional formatting allows you to color/shade fields on a record-by-record basis. You can apply conditional formatting to individual text boxes, but I'm not sure how to tell you to find it in the 2010 version.
Jun 4 '14 #5

twinnyfo
Expert Mod 2.5K+
P: 3,487
RMilano,

With conditional Formatting, you are able to change the Enabled Property of a text box. As long as the value of the TExt Box meets a particular set of criteria, you can either enable or disable that Text Box. This might serve the same purposes as what you are looking for.

Hope this hepps.
Jun 9 '14 #6

NeoPa
Expert Mod 15k+
P: 31,769
Ricardo, It may well be interesting to do so, but it still wouldn't make sense. As described in the linked thread the control is an object on the form and has no direct association with any record - current or otherwise.

So, however desirable you may find the idea, it still doesn't make sense.
Jun 10 '14 #7

Post your reply

Sign in to post your reply or Sign up for a free account.