Popup Form Launched from SubForm Button and New Record Sync

  • Follow


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,
tbl
0
Reply tbl 9/7/2007 9:21:39 PM

On Fri, 7 Sep 2007 15:18:03 -0700, SteveM
<SteveM@discussions.microsoft.com> wrote:

>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" wrote:
>
>> 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.

-- 
tbl
0
Reply tbl 9/10/2007 2:45:40 PM


1 Replies
419 Views

(page loaded in 0.063 seconds)

Similiar Articles:
















7/26/2012 12:05:06 PM


Reply: