How do i lock a child form, when parent has defined cond.

Jonathanw

Board Regular
Joined
May 3, 2004
Messages
73
Hi all,

I have a Database with a number of tables, the MAIN form has a sub-form of ITEM/COST, where individual items are entered.

I have implemented an authorisation system, where, once completed, and authorised, the status changes to Authorised, however, this does NOT lock the ITEM/COST, which is what I want.

When i tried to implement this, it locks all the records ITEM/COST form, not the specific record?

This is undesirable, as once Authorised, people can add to the list without need for further authorisation.

Private Sub Command161_Click()
Dim stPassword2 As String

stPassword2 = InputBox("Enter Password")
If stPassword2 = "********" Then
Status.Value = "Approved"
Else
Status.Value = "Incomplete"
End If
End Sub

This is the script that is used for authorisation, I would then like to lock the Form and Item/Cost Form from amendment, unless another password is entered, which i can implement no problem. it's more how do I lock the specific item/cost table for the single record.

I hope this makes sense, if not, let me know.

Thanks in advance
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Re: How do i lock a child form, when parent has defined cond

Alternatively, How fo I get the record to check the status, when using the back and forward buttins, and lock the relevant tables.

Private Sub Command161_Click()
Dim stPassword2 As String

stPassword2 = InputBox("Enter Password")
If stPassword2 = Record_Number Then
Status.Value = "Approved"
DoCmd.RunCommand acCmdRefresh
Form_ItemCost.AllowAdditions = False
Form_ItemCost.AllowEdits = False
Else
Status.Value = "Incomplete"
DoCmd.RunCommand acCmdRefresh
Form_ItemCost.AllowAdditions = True
Form_ItemCost.AllowEdits = True
End If
End Sub

This is the code I used, though, starting a new record from a complete, Approved record means the form is locked. If I unlock it upon a new record, it is possible to go back through the records, and make changes.

How can I best implement this.

Any help would be appreciated.
 
Upvote 0

Forum statistics

Threads
1,221,799
Messages
6,162,030
Members
451,738
Latest member
gaseremad

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top