I tried this:
Code:
INSERT INTO mailers ( contacts_first_filter_id, mailer_states_id, created_at )
VALUES (DLookup("id","update_mailer_step_two"), DLookup("id","mailer_states" & "mailer_state = 'sent'"), Now());
And it gives me error 'unknown'.
And then I tried this:
Code:
Private Sub Command6_Click()
Dim CFF_ID As String, MS_ID As String, strSQL As String
CFF_ID = "SELECT update_mailer_step_two.id FROM update_mailer_step_two"
MS_ID = "SELECT mailer_states.id FROM mailer_states WHERE mailer_states.mailer_state = 'sent'"
strSQL = "INSERT INTO mailers ( contacts_first_filter_id, mailer_states_id, created_at )VALUES ((" & CFF_ID & "),(" & MS_ID & "),NOW())"
DoCmd.RunSQL strSQL
End Sub
And this gives me "Query input must contain at least one table or query".
The suggestion you provided in post above won't work because there's nothing that joins the tables.
Thanks for response.