ChrisO
Registered User.
- Local time
- Tomorrow, 01:36
- 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:-
The target Form populates with:-
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.
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.