I know I posted most of this question in macros the other day, but I got no response, and I've added info to the problem. Hopefully, someone has something for me...thanks!
Here's what I have.
)> A macro that essentially directs Form1 to
>Save
1.OpenForm2
2.FindRecord based on matching ID field between the two forms (to see if individual exists in Form2)
3.GoToRecord New (if meets the condition that the ID doesn't exist in Form2)
4.SetValue (to match IDs)
and that's it. Form2 is based on a query of the table from Form1 and a supplemental data table. The macro does exactly what it's supposed to do when it's placed on the AfterUpdate event from a field on Form1's subform (important: the subform is created from several fields and Form1's ID, but is only a one-to-one relationship, so in my opinion is extraneous; no it's not storing the same data, I've just split the data into two tables).
Now here's my problem:
If I try to use the same macro to do the same thing on nearly the same form it doesn't work. The form is different in that it is just one form, and doesnt have the subform. All the data is just displayed on the one form. When I run the macro, it opens Form2 and even appears to update the ID number when not found, however, when I requery the form, the record seems to not be there. If I close and then open Form2 again (exclusive of the macro), the record is there.
Does anyone have any idea what might be going on here? Might the form with the subform be the way to go? I've tried re-doing the forms (i.e. pulling the subform into one version of the mainform and running the macro from there, and v/v taking the subform out of its form (adding again the appropriate fields, of course) and running the macro from there). It doesn't seem to matter they still both open up a new record, appear to add the info, but upon refreshing the screen they appear not to be there....(though it is when I re-open the form).
Any ideas?
Thanks a lot.
Here's what I have.
)> A macro that essentially directs Form1 to
>Save
1.OpenForm2
2.FindRecord based on matching ID field between the two forms (to see if individual exists in Form2)
3.GoToRecord New (if meets the condition that the ID doesn't exist in Form2)
4.SetValue (to match IDs)
and that's it. Form2 is based on a query of the table from Form1 and a supplemental data table. The macro does exactly what it's supposed to do when it's placed on the AfterUpdate event from a field on Form1's subform (important: the subform is created from several fields and Form1's ID, but is only a one-to-one relationship, so in my opinion is extraneous; no it's not storing the same data, I've just split the data into two tables).
Now here's my problem:
If I try to use the same macro to do the same thing on nearly the same form it doesn't work. The form is different in that it is just one form, and doesnt have the subform. All the data is just displayed on the one form. When I run the macro, it opens Form2 and even appears to update the ID number when not found, however, when I requery the form, the record seems to not be there. If I close and then open Form2 again (exclusive of the macro), the record is there.
Does anyone have any idea what might be going on here? Might the form with the subform be the way to go? I've tried re-doing the forms (i.e. pulling the subform into one version of the mainform and running the macro from there, and v/v taking the subform out of its form (adding again the appropriate fields, of course) and running the macro from there). It doesn't seem to matter they still both open up a new record, appear to add the info, but upon refreshing the screen they appear not to be there....(though it is when I re-open the form).
Any ideas?
Thanks a lot.