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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|