Pass Current Record OpenArgs. (1 Viewer)

Status
Not open for further replies.

ChrisO

Registered User.
Local time
Today, 18:14
Joined
Apr 30, 2003
Messages
3,202
Pass Current Record OpenArgs.

This is a demonstration of how to pass the current record through OpenArgs.

A pointer to the calling Form’s Recordset is passed through OpenArgs which enables direct population of the called Form.

The source Form opens the target Form with:-
Code:
    DoCmd.OpenForm FormName:="frmTarget", _
                   WindowMode:=acDialog, _
                   OpenArgs:=GetPointerToObject(Me.Recordset)

The target Form populates with:-
Code:
    Set Me.Recordset = GetObjectFromPointer(Me.OpenArgs)

Changes made in the called Form are directly written back to the calling Form’s bound Table.
This also applies to the addition of a new record.
No write back is required.




The demo is in Access 2003 (2000 file format).

Tested with:-
Version..............: Access 2003.
Regional settings.: English, French and German.
Error handling…...: None.
References……..…: None.

If you have any questions, please ask them in the appropriate forum.

Regards,
Chris.
 

Attachments

  • CurrentRecord_PassObject.zip
    71.9 KB · Views: 1,287
  • Image.jpg
    Image.jpg
    79.3 KB · Views: 2,752
Status
Not open for further replies.

Users who are viewing this thread

Top Bottom