Greetings, table 1 with data from fire calls. table 2 data of times for each fire call. open form for table 1 and add data for new call. while in table 1 form would like to click command button and open table 2 form (done) and add times for call in table 1 (done). close table 2 form with command button and go back to table 1 form. have primary key from table 2 inserted into foreign key field in table 1. table 1 form needs a text box to hold only the data from table 2 field tones (requery).
tables 2 has 8 fields:
1. callTimesId (autonumber) field
2. tones (short time)
3. leave hall (short time)
4. arrive scene (short time)
5. EMS only leave for hospital (short time)
6. EMS only arrive hospital (short time)
7. depart scene or hospital (short time)
8. in quarters (short time)
table 1 has, among others, a field named callTimesFK (number - long integer) to hold the table 2 primary key.
i have done something similar to this for not in list event with combo boxes. but i cannot puzzle out how to go about this one. i have the table 1 form and the table 2 form and i can open table 2 form from table 1 form. when i close table 2 form nothing is put in table 1.
code for opening table 2 form from table 1 form is simple open form event. here is code from close and save button on table 2 form:
Private Sub cmdCloseSaveTimes_Click()
On Error GoTo cmdCloseSaveTimes_Click_Err
On Error Resume Next
DoCmd.Close acForm, "frmCallTimes"
this works for combo boxes but i do not know how to tell it put the value in table 1. Can anyone point me in the right direction? many thanks.