O
oldblindpew
My question concerns how to reference and make use of composite keys in my
VBA code.
To choose and retrieve a record, I provide a command button on the
maintenance form. This button opens a dialog form which has an unbound list
box showing records in an appropriate order. When the desired item is
selected from the list box, the dialog form closes, and the selected record
is shown on the maintenance form.
When the record and its table employ a simple key, the critical command is
DoCmd.FindRecord. The key value of the selected record becomes the value of
the list box. The list box value is passed to a string variable, and
FindRecord operates on that string variable to find and display the record.
When the key is a surrogate autonumber key, things get more complicated,
involving recordsets and bookmarks.
But so far, the key has always been a single field. Now I have a table with
a composite key consisting of two fields. How can I get my code to work with
a multi-field key?
Thanks
VBA code.
To choose and retrieve a record, I provide a command button on the
maintenance form. This button opens a dialog form which has an unbound list
box showing records in an appropriate order. When the desired item is
selected from the list box, the dialog form closes, and the selected record
is shown on the maintenance form.
When the record and its table employ a simple key, the critical command is
DoCmd.FindRecord. The key value of the selected record becomes the value of
the list box. The list box value is passed to a string variable, and
FindRecord operates on that string variable to find and display the record.
When the key is a surrogate autonumber key, things get more complicated,
involving recordsets and bookmarks.
But so far, the key has always been a single field. Now I have a table with
a composite key consisting of two fields. How can I get my code to work with
a multi-field key?
Thanks