473,404 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

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

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
6 1357
jimatqsi
1,271 Expert 1GB
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
32,556 Expert Mod 16PB
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
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
jimatqsi
1,271 Expert 1GB
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
3,653 Expert Mod 2GB
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
32,556 Expert Mod 16PB
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

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

Similar topics

2
by: Ray | last post by:
I tried to change the field name in a query using "New Name: ". It did not work at all and just display the caption of the Field Name. Is it possible to change the field name or use a new caption...
3
by: supster | last post by:
I'de like to change only a specific line of a textbox. Right now I am doing: string texta = mainTextBox.Text.Split( "\n".ToCharArray() ); for ( int i = 0; i <= texta.Length-1; i++ ) {
3
by: Tom | last post by:
I am writing a Visual basic .Net database application. There are many forms that first let you select and look at a DB record and then when you click a "modify" button you are allowed to change...
11
by: Xero | last post by:
Hello. How do you erase a specific line in a *.txt file? Thanks in advance. -- Xero http://www.chezjeff.net My personal web portal
3
by: Dubya | last post by:
Hello Everyone, I have this little app, that I would like to configure two modes of operation by using command line arguments. If the app is started with no arguments, the Main UserForm shows...
2
by: Greg Strong | last post by:
Hello All, Is it possible to change table field lookup properties in code? I've been able to change other field properties in code, however so far no luck with field lookup properties. What...
4
by: sid derra | last post by:
hi i am trying to change the value of a text field on my page dynamically, every time an iframe loads. #========== the code where the text field is looks like this: <form...
16
by: cj | last post by:
Back in VB4 there was a line tool in my toolbox that allowed me to put a decorative line on the form somewhere. Does VB.net 2003 offer this? It's not in the toolbox and I can't find it in the list...
5
by: =?Utf-8?B?QWRhciBXZXNsZXk=?= | last post by:
Hi All, I have a GridView inside the EditItemTemplate of a FormView. Both FormView and GridView are data bound using an ObjectDataSource. When the FormView's ObjectDataSource object has a...
1
by: BulbFresh | last post by:
Hi, I have imported some data to a table, one field is whose values are in the form "dd/mm/yyyy 00:00:00" however I would like to run a command (possibly just after importing the table) to change...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.