Hi there, I have tried to follow the various techniques to do what I am trying but have not yet been successful. Let me tell you a little about what I am trying to do. We are a non-profit ambulance service and can't afford the fancy CAD systems for dispatch so I am trying to make a simple one for now. I have designed a main form that has all of the needed information that we collect when an ambulance is sent out that is stored in the table. I then added a subform that shows 8 "calls" at one time in a continuous forms view. This subform only shows a few selected fields from the table. I have the subform showing the 8 "calls" correctly and we can navigate through them with either the navigation tools, the record control, or a vertical scrollbar. What I would like to do is to be able to click on one of the "calls" in the subform and have the information display in the main form. I have tried to use the code that is below without sucess and I have tried the master/child link relatonship in the subform. The code doesn't do anything when I click on the little gray box next the the subform record and if I use the master/child link then the subform only shows one record instead of 8, although the main form and the subform are synced then.
Also, I need to be able to add records for the system. I thought about only allowing the dispatch to navigate through the subform and be able to start a new record from there, then once the new record is created and opened in the subform I believe that the main form would show the new record as well and allow the dispatcher to be able to enter the information into the main form window (if I get the first problem solved). Will this work?
Here is the code I tried in the subform:
Private Sub Form_Click()
Dim FormName As String, SyncCriteria As String
Dim f As Form, rs As Recordset
' form name to be syncronized
FormName = "Dispatch Log" ' <make sure this is the exact name of your Orders form.
DoCmd.OpenForm FormName
'Define the form object and recordset object for the Orders form
Set f = Forms(FormName)
Set rs = f.RecordsetClone
' define the criteria used for the sync
SyncCriteria = "[Run_Number]=" & Me![Run_Number]
' find the corresponding record in the Parts table
rs.FindFirst SyncCriteria
f.Bookmark = rs.Bookmark
End Sub
Thanks...Rick
Also, I need to be able to add records for the system. I thought about only allowing the dispatch to navigate through the subform and be able to start a new record from there, then once the new record is created and opened in the subform I believe that the main form would show the new record as well and allow the dispatcher to be able to enter the information into the main form window (if I get the first problem solved). Will this work?
Here is the code I tried in the subform:
Private Sub Form_Click()
Dim FormName As String, SyncCriteria As String
Dim f As Form, rs As Recordset
' form name to be syncronized
FormName = "Dispatch Log" ' <make sure this is the exact name of your Orders form.
DoCmd.OpenForm FormName
'Define the form object and recordset object for the Orders form
Set f = Forms(FormName)
Set rs = f.RecordsetClone
' define the criteria used for the sync
SyncCriteria = "[Run_Number]=" & Me![Run_Number]
' find the corresponding record in the Parts table
rs.FindFirst SyncCriteria
f.Bookmark = rs.Bookmark
End Sub
Thanks...Rick