A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Lock only updated record



 
 
Thread Tools Display Modes
  #1  
Old March 30th, 2010, 05:30 PM posted to microsoft.public.access.forms
Linda RQ[_2_]
external usenet poster
 
Posts: 76
Default Lock only updated record

Hi Everyone,

Using Access 2003. I have a patient database. I will try to explain as
best I can but I don't know the object names etc very well so let me know
what else I need to give if the info makes no sense. I have a subform of
patient therapy that shows on a main form. There are several fields with
therapy detail on my subform that get filled out when a therapy is started.
When the therapy is ended, the end date field is filled in. I need to lock
one field (therapy type) once a therapy is selected. The therapy type field
is a combobox with a list to select from. I tried going into the form
properties and locking the record and not allowing edits but then I couldn't
enter an end date later. I tried going into the control for therapy type
and locking that which worked but then I coudn't add therapy type to a new
record.

Is there anyway without vb code that I can prevent the user from changing
just that item once it has been entered?

Thanks,
Linda


  #2  
Old March 30th, 2010, 07:12 PM posted to microsoft.public.access.forms
Daryl S[_2_]
external usenet poster
 
Posts: 881
Default Lock only updated record

Linda -

Try something like this in the OnCurrent event for the form (use your
control name for cboName):

If me.cboName.column(0) is null then
Me.cboName.enabled = True
Else
Me.cboName.enabled = False
End If

--
Daryl S


"Linda RQ" wrote:

Hi Everyone,

Using Access 2003. I have a patient database. I will try to explain as
best I can but I don't know the object names etc very well so let me know
what else I need to give if the info makes no sense. I have a subform of
patient therapy that shows on a main form. There are several fields with
therapy detail on my subform that get filled out when a therapy is started.
When the therapy is ended, the end date field is filled in. I need to lock
one field (therapy type) once a therapy is selected. The therapy type field
is a combobox with a list to select from. I tried going into the form
properties and locking the record and not allowing edits but then I couldn't
enter an end date later. I tried going into the control for therapy type
and locking that which worked but then I coudn't add therapy type to a new
record.

Is there anyway without vb code that I can prevent the user from changing
just that item once it has been entered?

Thanks,
Linda


.

  #3  
Old March 31st, 2010, 01:53 AM posted to microsoft.public.access.forms
Linda RQ
external usenet poster
 
Posts: 81
Default Lock only updated record

Thanks Daryl...but I said no VB code puleeze...but ok, I'll try g. I can
sort of see what that is saying. This is what I did. I clicked in the
corner of the subform in the design view of the form and pulled up the
properties. I clicked in the OnCurrent event and went into build and pasted
your code. I compiled then saved. When I opened up the form in form view I
got a debug error and the second line below "If Me.ThpyTypeID_fk.Column(0)
Is Null Then" is highlighted in yellow.

Private Sub Form_Current()
If Me.ThpyTypeID_fk.Column(0) Is Null Then
Me.ThpyTypeID_fk.Enabled = True
Else
Me.ThpyTypeID_fk.Enabled = False
End If
End Sub



"Daryl S" wrote in message
...
Linda -

Try something like this in the OnCurrent event for the form (use your
control name for cboName):

If me.cboName.column(0) is null then
Me.cboName.enabled = True
Else
Me.cboName.enabled = False
End If

--
Daryl S


"Linda RQ" wrote:

Hi Everyone,

Using Access 2003. I have a patient database. I will try to explain as
best I can but I don't know the object names etc very well so let me know
what else I need to give if the info makes no sense. I have a subform of
patient therapy that shows on a main form. There are several fields
with
therapy detail on my subform that get filled out when a therapy is
started.
When the therapy is ended, the end date field is filled in. I need to
lock
one field (therapy type) once a therapy is selected. The therapy type
field
is a combobox with a list to select from. I tried going into the form
properties and locking the record and not allowing edits but then I
couldn't
enter an end date later. I tried going into the control for therapy type
and locking that which worked but then I coudn't add therapy type to a
new
record.

Is there anyway without vb code that I can prevent the user from changing
just that item once it has been entered?

Thanks,
Linda


.



  #4  
Old March 31st, 2010, 02:13 AM posted to microsoft.public.access.forms
Rob Parker[_3_]
external usenet poster
 
Posts: 173
Default Lock only updated record

Hi Linda,

The syntax is wrong; the line should be:
....
If IsNull(Me.ThpyTypeID_fk.Column(0)) Then
....

HTH,

Rob


Linda RQ wrote:
Thanks Daryl...but I said no VB code puleeze...but ok, I'll try g. I can
sort of see what that is saying. This is what I did. I
clicked in the corner of the subform in the design view of the form
and pulled up the properties. I clicked in the OnCurrent event and
went into build and pasted your code. I compiled then saved. When I
opened up the form in form view I got a debug error and the second
line below "If Me.ThpyTypeID_fk.Column(0) Is Null Then" is
highlighted in yellow.
Private Sub Form_Current()
If Me.ThpyTypeID_fk.Column(0) Is Null Then
Me.ThpyTypeID_fk.Enabled = True
Else
Me.ThpyTypeID_fk.Enabled = False
End If
End Sub



"Daryl S" wrote in message
...
Linda -

Try something like this in the OnCurrent event for the form (use your
control name for cboName):

If me.cboName.column(0) is null then
Me.cboName.enabled = True
Else
Me.cboName.enabled = False
End If

--
Daryl S


"Linda RQ" wrote:

Hi Everyone,

Using Access 2003. I have a patient database. I will try to
explain as best I can but I don't know the object names etc very
well so let me know what else I need to give if the info makes no
sense. I have a subform of patient therapy that shows on a main
form. There are several fields with
therapy detail on my subform that get filled out when a therapy is
started.
When the therapy is ended, the end date field is filled in. I need
to lock
one field (therapy type) once a therapy is selected. The therapy
type field
is a combobox with a list to select from. I tried going into the
form properties and locking the record and not allowing edits but
then I couldn't
enter an end date later. I tried going into the control for
therapy type and locking that which worked but then I coudn't add
therapy type to a new
record.

Is there anyway without vb code that I can prevent the user from
changing just that item once it has been entered?

Thanks,
Linda


.



  #5  
Old March 31st, 2010, 02:42 PM posted to microsoft.public.access.forms
Daryl S[_2_]
external usenet poster
 
Posts: 881
Default Lock only updated record

Thanks Rob - I guess I've been doing too much SQL lately!

--
Daryl S


"Rob Parker" wrote:

Hi Linda,

The syntax is wrong; the line should be:
....
If IsNull(Me.ThpyTypeID_fk.Column(0)) Then
....

HTH,

Rob


Linda RQ wrote:
Thanks Daryl...but I said no VB code puleeze...but ok, I'll try g. I can
sort of see what that is saying. This is what I did. I
clicked in the corner of the subform in the design view of the form
and pulled up the properties. I clicked in the OnCurrent event and
went into build and pasted your code. I compiled then saved. When I
opened up the form in form view I got a debug error and the second
line below "If Me.ThpyTypeID_fk.Column(0) Is Null Then" is
highlighted in yellow.
Private Sub Form_Current()
If Me.ThpyTypeID_fk.Column(0) Is Null Then
Me.ThpyTypeID_fk.Enabled = True
Else
Me.ThpyTypeID_fk.Enabled = False
End If
End Sub



"Daryl S" wrote in message
...
Linda -

Try something like this in the OnCurrent event for the form (use your
control name for cboName):

If me.cboName.column(0) is null then
Me.cboName.enabled = True
Else
Me.cboName.enabled = False
End If

--
Daryl S


"Linda RQ" wrote:

Hi Everyone,

Using Access 2003. I have a patient database. I will try to
explain as best I can but I don't know the object names etc very
well so let me know what else I need to give if the info makes no
sense. I have a subform of patient therapy that shows on a main
form. There are several fields with
therapy detail on my subform that get filled out when a therapy is
started.
When the therapy is ended, the end date field is filled in. I need
to lock
one field (therapy type) once a therapy is selected. The therapy
type field
is a combobox with a list to select from. I tried going into the
form properties and locking the record and not allowing edits but
then I couldn't
enter an end date later. I tried going into the control for
therapy type and locking that which worked but then I coudn't add
therapy type to a new
record.

Is there anyway without vb code that I can prevent the user from
changing just that item once it has been entered?

Thanks,
Linda


.



.

  #6  
Old March 31st, 2010, 08:06 PM posted to microsoft.public.access.forms
Linda RQ
external usenet poster
 
Posts: 81
Default Lock only updated record

Yea, thanks Rob but thanks Daryl too. I did it!

Linda


"Daryl S" wrote in message
...
Thanks Rob - I guess I've been doing too much SQL lately!

--
Daryl S


"Rob Parker" wrote:

Hi Linda,

The syntax is wrong; the line should be:
....
If IsNull(Me.ThpyTypeID_fk.Column(0)) Then
....

HTH,

Rob


Linda RQ wrote:
Thanks Daryl...but I said no VB code puleeze...but ok, I'll try g. I
can
sort of see what that is saying. This is what I did. I
clicked in the corner of the subform in the design view of the form
and pulled up the properties. I clicked in the OnCurrent event and
went into build and pasted your code. I compiled then saved. When I
opened up the form in form view I got a debug error and the second
line below "If Me.ThpyTypeID_fk.Column(0) Is Null Then" is
highlighted in yellow.
Private Sub Form_Current()
If Me.ThpyTypeID_fk.Column(0) Is Null Then
Me.ThpyTypeID_fk.Enabled = True
Else
Me.ThpyTypeID_fk.Enabled = False
End If
End Sub



"Daryl S" wrote in message
...
Linda -

Try something like this in the OnCurrent event for the form (use your
control name for cboName):

If me.cboName.column(0) is null then
Me.cboName.enabled = True
Else
Me.cboName.enabled = False
End If

--
Daryl S


"Linda RQ" wrote:

Hi Everyone,

Using Access 2003. I have a patient database. I will try to
explain as best I can but I don't know the object names etc very
well so let me know what else I need to give if the info makes no
sense. I have a subform of patient therapy that shows on a main
form. There are several fields with
therapy detail on my subform that get filled out when a therapy is
started.
When the therapy is ended, the end date field is filled in. I need
to lock
one field (therapy type) once a therapy is selected. The therapy
type field
is a combobox with a list to select from. I tried going into the
form properties and locking the record and not allowing edits but
then I couldn't
enter an end date later. I tried going into the control for
therapy type and locking that which worked but then I coudn't add
therapy type to a new
record.

Is there anyway without vb code that I can prevent the user from
changing just that item once it has been entered?

Thanks,
Linda


.



.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:52 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.