J
Jennifer Crawford
I have an odd problem. I have a button on a form which
previews a report that is based on information from that
record. The problem is that if I make a change to the data
(when Me.Dirty = True) and then preview the report, that
change is not reflected in the report displayed. I can
only see the change if I move to another record, then move
back to the original record and preview the report again.
I realize that this is occurring because the record that
is displayed has not yet been updated to the table, which
is why when I move to another record (or a child record),
the report works (since that, by default, saves the
changed record). However, I need to be able to force that
save within VBA instead of requiring the user to manually
move from one record to the other.
I have tried setting the focus to a subform's field (since
I can manually go to a subform, click a field, and then
preview the report with the correct data), but this does
not seem to work when attempted in VBA, even though the
code to set the focus to the child field does not produce
any errors.
Any suggestions as to how to remedy this via VBA, so that
when the button is pressed, the report previewed contains
the most current data? DoCmd.Save only saves the form, not
the record, from what I can see (unless I'm missing
something).
Thanks,
Jennifer Crawford
previews a report that is based on information from that
record. The problem is that if I make a change to the data
(when Me.Dirty = True) and then preview the report, that
change is not reflected in the report displayed. I can
only see the change if I move to another record, then move
back to the original record and preview the report again.
I realize that this is occurring because the record that
is displayed has not yet been updated to the table, which
is why when I move to another record (or a child record),
the report works (since that, by default, saves the
changed record). However, I need to be able to force that
save within VBA instead of requiring the user to manually
move from one record to the other.
I have tried setting the focus to a subform's field (since
I can manually go to a subform, click a field, and then
preview the report with the correct data), but this does
not seem to work when attempted in VBA, even though the
code to set the focus to the child field does not produce
any errors.
Any suggestions as to how to remedy this via VBA, so that
when the button is pressed, the report previewed contains
the most current data? DoCmd.Save only saves the form, not
the record, from what I can see (unless I'm missing
something).
Thanks,
Jennifer Crawford