ShaneMan said:
If you think there are going to be a fair amount of shops, then maybe one suggestion that I can throw your way. Use a continuous form to show all shops. Be sure to add the ShopID, then use a command button over the top of both fields and set it to transparent, then code so that it opens a form, using the ShopID as criteria, which would show a single shops information. You could then add a separate command button in the header that would allow the user to add a new shop. It's still in a list view format so you may not like that idea but I thought I would throw out there.
Shane
I use Shanes idea of a continuous form as well - however I make the colour of one field eg ShopID or ShopName etc different to the other columns and have the user double click on that. Heres an example of the code in the continuous form frmJobs:
Private Sub txtTitle_DblClick(Cancel As Integer)
Dim DocName As String
Dim LinkCriteria As String
DocName = "frmJob"
LinkCriteria = "[JobID] = Forms!frmjobs![JobID]"
DoCmd.OpenForm DocName, , , LinkCriteria
End Sub
(lazy me - no error trapping in the above)
Here the user double clicks on a different field to the one that is in the LinkCriteria - you must have an unique field in the LinkCriteria line, in this case the JobID (PK).
For a new record I have a button "New Job" in the Header section of the form. Heres the code for the Click event:
Private Sub cmdNewJob_Click()
On Error GoTo Err_cmdNewJob_Click
DoCmd.OpenForm ("frmJob")
DoCmd.GoToRecord , , acNewRec
Exit_cmdNewJob_Click:
Exit Sub
Err_cmdNewJob_Click:
MsgBox Err.Description
Resume Exit_cmdNewJob_Click
End Sub
Hope this helps you.