Popup Form Launched from SubForm Button and New Record Sync

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.
 
G

Guest

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
 
T

tbl

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top