J
J.J.
I posted this in forms design yesterday and probably should have been in
forms coding
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(a report is also
genrated). The customer name is filtered from an initiator form via a button
at which time this form initiator closes.
Initially, the new appt form properly displayed the customer name and
customer ID. Not being a coder and using some posted code, I was able to set
an Outlook appointment with the customer name inserted into the subject field
of Outlook etc.
However, because I wanted to insert this new appointment date, time and
details in the Orders table, I needed to change the form to include a
sub-form which opens with DoCmd.GoToRecord , , acNewRec because of the one to
many relationship between customers and orders.
Because the subform now 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
while
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
forms coding
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(a report is also
genrated). The customer name is filtered from an initiator form via a button
at which time this form initiator closes.
Initially, the new appt form properly displayed the customer name and
customer ID. Not being a coder and using some posted code, I was able to set
an Outlook appointment with the customer name inserted into the subject field
of Outlook etc.
However, because I wanted to insert this new appointment date, time and
details in the Orders table, I needed to change the form to include a
sub-form which opens with DoCmd.GoToRecord , , acNewRec because of the one to
many relationship between customers and orders.
Because the subform now 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
while
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