C
CB
Hi everyone,
I have a question regarding the following code that I’ve placed in the
current event of a sub-form. Clearly, I’m misunderstanding something. A
little background first…
A parent record (i.e., Quote Request) selected on the main form can be
linked to one or more child records (i.e. Work Order submissions) on the
subform. My intention was that depending on the value of “txtWOStatus,â€
certain fields would be locked ONLY FOR THOSE PARTICULAR CHILD RECORDS. For
example, if a work order was accepted, I’m trying to prevent the user from
adding another work order to the Quote Request selected on the main form.
What is happening is that when I select a different parent record on the
main form, certain cells are locked based on the value of “txtWOStatus†in
the previous child record I looked at. I hope I explained that clearly enough!
What am I missing?
Thanks for any and all suggestions!
Chris
Private Sub Form_Current()
Select Case Me.txtWOStatus
Case "Amendment Requested"
Me.txtWOCompDate.Locked = True
Me.txtWOActAmt.Locked = True
Me.txtWOActLink.Locked = True
MsgBox ("You cannot enter completion information on this record
as an amendment was requested." & vbCrLf & _
"Enter the information on the record where the word order
was Accepted.")
Case "Accepted"
Me.txtWONum.Locked = True
Me.txtWONumRev.Locked = True
Me.txtWODate.Locked = True
Me.txtWOEstAmt.Locked = True
Me.txtWOStatus.Locked = True
Me.txtWOComment.Locked = True
Me.txtSMID.Locked = True
Me.txtWOCompDate.Locked = True
Me.txtWOActAmt.Locked = True
Me.txtWOActLink.Locked = True
MsgBox ("You cannot add another work order to this quote number
as the last work order was accepted.")
Case "Rejected"
Me.txtWOCompDate.Locked = True
Me.txtWOActAmt.Locked = True
Me.txtWOActLink.Locked = True
End Select
End Sub
I have a question regarding the following code that I’ve placed in the
current event of a sub-form. Clearly, I’m misunderstanding something. A
little background first…
A parent record (i.e., Quote Request) selected on the main form can be
linked to one or more child records (i.e. Work Order submissions) on the
subform. My intention was that depending on the value of “txtWOStatus,â€
certain fields would be locked ONLY FOR THOSE PARTICULAR CHILD RECORDS. For
example, if a work order was accepted, I’m trying to prevent the user from
adding another work order to the Quote Request selected on the main form.
What is happening is that when I select a different parent record on the
main form, certain cells are locked based on the value of “txtWOStatus†in
the previous child record I looked at. I hope I explained that clearly enough!
What am I missing?
Thanks for any and all suggestions!
Chris
Private Sub Form_Current()
Select Case Me.txtWOStatus
Case "Amendment Requested"
Me.txtWOCompDate.Locked = True
Me.txtWOActAmt.Locked = True
Me.txtWOActLink.Locked = True
MsgBox ("You cannot enter completion information on this record
as an amendment was requested." & vbCrLf & _
"Enter the information on the record where the word order
was Accepted.")
Case "Accepted"
Me.txtWONum.Locked = True
Me.txtWONumRev.Locked = True
Me.txtWODate.Locked = True
Me.txtWOEstAmt.Locked = True
Me.txtWOStatus.Locked = True
Me.txtWOComment.Locked = True
Me.txtSMID.Locked = True
Me.txtWOCompDate.Locked = True
Me.txtWOActAmt.Locked = True
Me.txtWOActLink.Locked = True
MsgBox ("You cannot add another work order to this quote number
as the last work order was accepted.")
Case "Rejected"
Me.txtWOCompDate.Locked = True
Me.txtWOActAmt.Locked = True
Me.txtWOActLink.Locked = True
End Select
End Sub