J
J.J.
What I hoped to do was set an appointment (subject, date,time and notes) in
Outlook while at the same time updating the Orders table with the same date,
time and related details and all from the same form. The customer name is
filtered from an initiator form via a button at which time this form closes.
The new appt form properly displays the customer name and customer ID. Mot
being a coder, I was able to set an Outlook appointment with the customer
name inserted into the subject field of Outlook etc. using some posted code.
However, to insert a new appointment date, time and details in the Orders
table, I needed a sub-form which opens with DoCmd.GoToRecord , , acNewRec.
Because the subform opens with a new record, the customer ID shows as (New)
in the sub-form rather than the value brought over from the initiator form
and so now my code won't run. The correct customer name and ID remains in
the main form. From main form, the combined "Create Outlook Appt/Save
Record" button causes an error as the subform Date time etc. is not found and
from the subform this same button causes an error as the customer is not
found.
Is there a way to reference the customer name in the sub-form so I can
export the name to Outlook? DLookup won't work and shows "Error?"
Alternately, is there a way to open the appt form as a single form and yet
force date, time and details to be saved to a new record and filtered on the
initiated customer ID? I did try using Before/After Insert and Before/After
Update with DoCmd.GoToRecord , , acNewRec but maybe my code was wrong.
Thank you
Outlook while at the same time updating the Orders table with the same date,
time and related details and all from the same form. The customer name is
filtered from an initiator form via a button at which time this form closes.
The new appt form properly displays the customer name and customer ID. Mot
being a coder, I was able to set an Outlook appointment with the customer
name inserted into the subject field of Outlook etc. using some posted code.
However, to insert a new appointment date, time and details in the Orders
table, I needed a sub-form which opens with DoCmd.GoToRecord , , acNewRec.
Because the subform opens with a new record, the customer ID shows as (New)
in the sub-form rather than the value brought over from the initiator form
and so now my code won't run. The correct customer name and ID remains in
the main form. From main form, the combined "Create Outlook Appt/Save
Record" button causes an error as the subform Date time etc. is not found and
from the subform this same button causes an error as the customer is not
found.
Is there a way to reference the customer name in the sub-form so I can
export the name to Outlook? DLookup won't work and shows "Error?"
Alternately, is there a way to open the appt form as a single form and yet
force date, time and details to be saved to a new record and filtered on the
initiated customer ID? I did try using Before/After Insert and Before/After
Update with DoCmd.GoToRecord , , acNewRec but maybe my code was wrong.
Thank you