J
jenna
Good day to you all! (it's my first time here
)
I have created a couple of single forms (some also have subforms). The
records in each form are locked from edition/addition/deletion, but can be
unlocked by clicking a button and enter the correct password.
The problem with some of these forms (with no subform in it) is that certain
records can't be edited or deleted because one field "Initial" is also used
in another table. I suppose I need requery the relative table in another
form, but I don't know how should this be done. Can someone please help? Many
thanks!
-- below are codes that save changes to the query qryStaffList --
Private Sub cmbSaveEditStaff_Click()
' First save amendment to qryStaffList
mfSave = True
' Then
' Unhide the command button cmbEditExistingStaff
[cmbEditStaff].Visible = True
' Send focus to cmbEditStaff
Me.cmbEditStaff.SetFocus
' Hide the command button cmbSaveEditStaff
[cmbSaveEditStaff].Visible = False
' Unhide cboStaff and update its rowsource
cboStaff.Visible = True
Me.cboStaff.Requery
' Lock fields from edit
Me.Initials.Locked = True
Me.Telephone.Locked = True
Me.HireDate.Locked = True
Me.Photo.Locked = True
End Sub
-- end of codes --
I have created a couple of single forms (some also have subforms). The
records in each form are locked from edition/addition/deletion, but can be
unlocked by clicking a button and enter the correct password.
The problem with some of these forms (with no subform in it) is that certain
records can't be edited or deleted because one field "Initial" is also used
in another table. I suppose I need requery the relative table in another
form, but I don't know how should this be done. Can someone please help? Many
thanks!
-- below are codes that save changes to the query qryStaffList --
Private Sub cmbSaveEditStaff_Click()
' First save amendment to qryStaffList
mfSave = True
' Then
' Unhide the command button cmbEditExistingStaff
[cmbEditStaff].Visible = True
' Send focus to cmbEditStaff
Me.cmbEditStaff.SetFocus
' Hide the command button cmbSaveEditStaff
[cmbSaveEditStaff].Visible = False
' Unhide cboStaff and update its rowsource
cboStaff.Visible = True
Me.cboStaff.Requery
' Lock fields from edit
Me.Initials.Locked = True
Me.Telephone.Locked = True
Me.HireDate.Locked = True
Me.Photo.Locked = True
End Sub
-- end of codes --