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

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

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

Jan 26 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a

"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

P: n/a
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

P: n/a
"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 discussion thread is closed

Replies have been disabled for this discussion.