473,395 Members | 1,941 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,395 software developers and data experts.

Have on option group but need one of the option buttons when clicked to allow editing to a certain field

I need to have an option button that allows editing to a field only
when it is checked.

Jan 26 '06 #1
5 2653
Option buttons in an option group will usually have values of 1 to the
number of buttons, for example, if your group has five option buttons, they
would have the values 1 to 5. I'm presuming your field is normally locked
and you want to unlock it with one of the option buttons. Put the following
code in the AfterUpdate event of the option group:

Select Case Me!NameOfOptionGroup
Case 1
<Do Something .....>
Case 2
<Do Something .....>
Case 3
Me!NameOfTextBoxBoundToField.Locked = False
Case 4
<Do Something .....>
Case 5
<Do Something .....>
End Select

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1100 users have come to me from the newsgroups requesting help
re******@pcdatasheet.com

<ts*****@cetusgroup.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I need to have an option button that allows editing to a field only
when it is checked.

Jan 26 '06 #2
ts*****@cetusgroup.com wrote:
I need to have an option button that allows editing to a field only
when it is checked.


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

If the check box's (not an option button) name is chkEditable and the
other Control (not a field) is a Text Box named txtThisControl:

Priate Sub chkEditable_AfterUpdate()

Me!txtThisControl.Enabled = Me!chkEditable = True

End Sub

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQ9lDzoechKqOuFEgEQIg+ACgkh1lsAU4/WHVWLUl7/UzN8SQwykAoJhY
M/dnSP87HK/hFkzkk8/Qv834
=dDow
-----END PGP SIGNATURE-----
Jan 26 '06 #3

"PC Datasheet" <no****@nospam.spam> schreef in bericht news:Ck*****************@newsread2.news.atl.earthl ink.net...
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1100 users have come to me from the newsgroups requesting help
re******@pcdatasheet.com



To Steve:
Over 300 users from the newsgroups have visited the website to read what kind of a 'resource' you are...

--
To the original poster:

Most people here have a common belief that the newsgroups are for *free exchange of information*.
But Steve is a notorious job hunter in these groups, always trying to sell his services.

Before you intend to do business with him look at:
http://home.tiscali.nl/arracom/whoissteve.html (updated)

Arno R
Jan 26 '06 #4
Ted
You can have the form default to having one or more fields locked.
I have created applications which by default have the fields locked so
that the user does not accidentally modify a field.
Clicking on a button runs through a routine which unlocks the fields so
they can be edited. Set the default property of the field to Locked and
use the AfterUpdate property of the field to check it's value. If it
equals the value 0 (unchecked) then unlock the field(s), otherwise lock
them.
The button the user sees on the form is actually two buttons, one on
top of the other.
If I click on the Unlock button, it unlocks the fields then the
property of the button is switched to not visible and the property of
the Lock button becomes visible. When the Lock button is clicked it
locks the field(s), becomes not visible and the UnLock button becomes
visible again.
The default is the UnLock button is visible and the Lock button is not
visible.
The default for the fields in question are locked when you open the
form and when you navigate to a new record those fields are also
locked.
I use the OnCurrent event for the form to assure the fields are locked
if I navigate to a different record.

Jan 27 '06 #5
"Ted" <be*****@gmail.com> wrote in
news:11**********************@g43g2000cwa.googlegr oups.com:
You can have the form default to having one or more fields
locked. I have created applications which by default have the
fields locked so that the user does not accidentally modify a
field. Clicking on a button runs through a routine which
unlocks the fields so they can be edited. Set the default
property of the field to Locked and use the AfterUpdate
property of the field to check it's value. If it equals the
value 0 (unchecked) then unlock the field(s), otherwise lock
them.
The button the user sees on the form is actually two buttons,
one on top of the other.
If I click on the Unlock button, it unlocks the fields then
the property of the button is switched to not visible and the
property of the Lock button becomes visible. When the Lock
button is clicked it locks the field(s), becomes not visible
and the UnLock button becomes visible again.
The default is the UnLock button is visible and the Lock
button is not visible.
The default for the fields in question are locked when you
open the form and when you navigate to a new record those
fields are also locked.
I use the OnCurrent event for the form to assure the fields
are locked if I navigate to a different record.

no need to use two buttons.

if Me.Lockedfield.locked then
' unlock and run other changes
me.lockedfield.locked = false
'change the caption
me.lockedfield.caption = "lock the field"
else
me.lockedfield.locked = true
me.lockedfield.caption = "unlock the field"
end if
--
Bob Quintal

PA is y I've altered my email address.
Jan 28 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Jason | last post by:
Let's say I have an html form with 20 or 30 fields in it. The form submits the fields via POST to a php page which updates a table in a database with the $_POST vars. Which makes more sense? ...
5
by: Georges Heinesch | last post by:
Hi. I created an option group using the wizard. I included 3 option buttons. An option group (in general) can be enabled or disabled completely (includung option buttons and their respective...
2
by: Chuck Insight | last post by:
Hi All, The table underlying this form has three yes/no fields that refuse to work as selections within my option group. How can I make this happen? Thanks very much, Chuck
6
by: DFS | last post by:
I swear that sometimes things behave differently from one day to the next. Access 2003. Example: I have 4 radio buttons that set the rowsource of a combobox depending on which option you choose....
20
by: PC Datasheet | last post by:
How can the label for a checkbox and the labels for the options in an option group be addressed? When a checkbox gets the focus, Access draws a dotted box around the label. When an option group...
6
by: Terry | last post by:
Good morning! How do I determine which SELECT button was clicked in a GridView? The multiple SELECT buttons will be used for an application approval process. Thank you in advance for your...
2
by: news reader | last post by:
Hi, Does anoone of you know if there is already a simple application doing something like this. I would enhance / tune the missing features, but would like to avoid to start from scratch or...
3
by: Andrew | last post by:
I am new to VBA Please can someone help get me started. I need to know how to use an if statement to check if a button has been pressed i.e. if button 1 is pressed a file will be imported from...
1
by: JHawk24821 | last post by:
I am building a simple card matching game where the user picks two buttons on a form out of a group of buttons in an attempt to find a match. I have already taken care of the randomization needed...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.