Hi Rick
I have a main form with about 15 command buttons the code for the command
button is
Private Sub Command18_Click()
On Error GoTo Err_Command155_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Entity Form"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command155_Click:
Exit Sub
Err_Command155_Click:
MsgBox Err.Description
Resume Exit_Command155_Click
End Sub
Each command button represents a department (pre defined department number
say ranging from 10 to 25)
The main form is based on the a table of all the deparments numbers
so when you click one of the command button you choose a department "say 10"
which bring up the department details
The sub form is based on all sales for that department, one of the filed is
deparment number , which is linked with the master and child to the main form
so any transaction on the sub form are filtered by the dep no on the main
form.
So coming back to my original thought was that when one of the the command
button on the main form is selected it would open up the main form with the
predefinded department number somewhere in the code above.
Long winded but thats all of it.
Thanks
Danny