Rusty
Registered User.
- Local time
- Today, 14:52
- Joined
- Apr 15, 2004
- Messages
- 207
Hi guys,
I have a subform which contains data on different people working on the projects detailed in the main form.
The subform has a command button which deletes a person from a project. (just a delete function basically). But if there is only one person on the project I do not want this delete function to work.
I have tried working out the code along the lines of the stuff below but am unsure how to put the VBA equivalent of “if there is only 1 record, then”
Any help would be greatly appreciated.
Cheers,
Rusty

I have a subform which contains data on different people working on the projects detailed in the main form.
The subform has a command button which deletes a person from a project. (just a delete function basically). But if there is only one person on the project I do not want this delete function to work.
I have tried working out the code along the lines of the stuff below but am unsure how to put the VBA equivalent of “if there is only 1 record, then”
Any help would be greatly appreciated.
Cheers,
Rusty
Code:
Private Sub cmdDeleteSelectedRecord_Click()
‘if there is only 1 record, then
Cancel = True
Else
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
End If
End Sub