Re: Change a form control's llow edits property to No if it is Not
- From: "Douglas J. Steele" <NOSPAM_djsteele@xxxxxxxxxxxxxxxx>
- Date: Sat, 5 Sep 2009 08:57:49 -0400
Try starting with what Crystal has at
http://www.accessmvp.com/Strive4Peace/VBA/Index.htm
Once you've mastered that, check out the references Jeff Conrad has at
http://www.accessmvp.com/JConrad/accessjunkie/resources.html#Books for which
books to look at.
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"Chris v." <Chrisv@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:33A81CF5-3663-495D-9B23-124A2B91900F@xxxxxxxxxxxxxxxx
It worked like a charm. Thank you. Can you recommend how/where I can learn
VBA online or which book to start with, or both? Your code was most
helpful.
:)
"Douglas J. Steele" wrote:
Why not lock the control if it has data? In the Current event of the form
being used as a subform, try something like:
Private Sub Form_Current()
Dim ctlCurr As Control
For Each ctlCurr In Me.Controls
Select Case ctlCurr.ControlType
Case acTextBox, acListBox, acComboBox
ctlCurr.Locked = (Len(ctlCurr.Value & vbNullString) > 0)
End Select
Next ctlCurr
End Sub
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Chris v." <Chrisv@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:70263424-E8C4-4508-ACAF-096723EE7A1B@xxxxxxxxxxxxxxxx
I'm using Access 2007 and have an "Input" form with sub forms. The Main
form's Allow Edits property is set to yes, while the controls on the
main
form are locked so the user can ONLY look-up clients. The sub forms is
where
the data entry happens. However, if the sub form already has data, that
data
shouldn't be modifiable. Yet, if any of the sub-form's fields are null,
I
want the user to be able to enter the appropriate data. So me questions
are:
1) How can I do this? and 2) Is this a bad design?
.
- References:
- Change a form control's llow edits property to No if it is Not Nul
- From: Chris v.
- Re: Change a form control's llow edits property to No if it is Not Nul
- From: Douglas J. Steele
- Re: Change a form control's llow edits property to No if it is Not
- From: Chris v.
- Change a form control's llow edits property to No if it is Not Nul
- Prev by Date: Re: Displaying Pictures on Forms
- Next by Date: Re: Using a Combo Box to find a Record
- Previous by thread: Re: Change a form control's llow edits property to No if it is Not
- Next by thread: Designing form
- Index(es):
Relevant Pages
|