Popup Form Launched from SubForm Button and New Record Sync

  • Thread starter Thread starter tbl
  • Start date Start date
T

tbl

A subform (continuous) has a button, repeated on each row,
to pop up a filtered (synchronised) form. When the popup
comes to a new record, I'd like it to sync with the record
on the subform that popped it up. But the subform is used
in several different main forms, so I'd like to avoid using
the main form's name in the code. I've tried naming the
subform directly, but can't seem to get a spark.

If Me.NewRecord then

Me![txtIvDetId]= Form![My-still open-Subform]![txtIvDetId]

End If


But I can't seem to make it work.

Any suggestions appreciated.
 
Look at the Access help for OpenArgs.

When you open the form with DoCmd.OpenForm, you can include avalue in the
7th argument. You can then use that value in your form/subform without having
to reference the calling form.

Steve
 
Look at the Access help for OpenArgs.

When you open the form with DoCmd.OpenForm, you can include avalue in the
7th argument. You can then use that value in your form/subform without having
to reference the calling form.

Steve

tbl said:
A subform (continuous) has a button, repeated on each row,
to pop up a filtered (synchronised) form. When the popup
comes to a new record, I'd like it to sync with the record
on the subform that popped it up. But the subform is used
in several different main forms, so I'd like to avoid using
the main form's name in the code. I've tried naming the
subform directly, but can't seem to get a spark.

If Me.NewRecord then

Me![txtIvDetId]= Form![My-still open-Subform]![txtIvDetId]

End If


But I can't seem to make it work.

Any suggestions appreciated.


Thanks Steve. That seems to work very well.
 
Back
Top