Search form to open with Foreign Key ID of previous record.

L

Liz James

I have a search form where user selects a track name and all the points along
the track drop down in the second combo box.
The form is bound to a query with Track ID and trackname.

Both combos are unbound.
After the user selects a point on the track in the second combo, a form
opens to update the record for that point and the search form needs to close
to enable the update form to save the updated record.

When the update form closes I would like the search form to re-open at the
previous TrackID and trackname, as users often need to update several points
on the same track in a session.

I have tried setting a default TrackID with the afterupdate of the first
combo, and tried with the afterupdate for the form, neither worked.

I have tried using openargs from the Update form closing,
DoCmd.OpenForm "frmSearchform", , , , , , Me.[txtTrID]
DoCmd.Close acForm, "frmUpdateform"

I have tried using find first,
DoCmd.OpenForm "frmSearchform", , , "[TrID]=" & Me![txtTrID]
DoCmd.Close acForm, "frmUpdateform"

When the search form opens I have tried
Me.cboSelTrack.Column(0) = Me.OpenArgs

I have tried with a textbox on the search form txtTrID
Me.txtTrID = Me.OpenArgs

The search form has code on afterupdate to set the default TrackID,
code for the onload event for the openargs, code for both combos and code
for an exit button, otherwise very straightforward.

Nothing will work for me, is there something I am missing?
 
Top