Hi James
Is your Form_Load procedure being executed? The "On Load" cell in the
form's property sheet should say [Event Procedure].
Try temporarily inserting a Stop command just before If Not IsNull...
Then the code execution will break there and you can step through it
line by line with F8.
You can also examine values in the Immediate window to verify that
things are going to plan. For example:
?Me.OpenArgs
will show you what value was passed to the form.
--
Good Luck
Graham Mandeno [Access MVP]
Auckland, New Zealand
frmDvdEdit continues to open on the first record.
I put the DoCmd on the OnClick of the Command Button of frmDvd. And
the other code in the OnLoad of DvdEdit.
Can't understand,
James
Hi James
Normally you would use the WhereCondition argument to create a filter
as the second form opens:
DoCmd.OpenForm "frmDvdEdit", _
WhereCondition:="DvdMovieID=" & Me!DvdMovieID
However, this will give you only one record so, instead, pass the ID
through OpenArgs and have the Form_Load event procedure navigate to
the initial record:
DoCmd.OpenForm "frmDvdEdit", OpenArgs:=Me.DvdMovieID
... and in frmDvdEdit.Form_Load:
If Not IsNull(Me.OpenArgs) Then
With Me.RecordsetClone
.FindFirst "DvdMovieID=" & Me.OpenArgs
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With
End If
--
Good Luck
Graham Mandeno [Access MVP]
Auckland, New Zealand
I want to have a command button, on form frmDvd, open form frmDvdEdit
to the same record that is the current record on frmDvd. Also, I want
to
be able to 'browse' using the frmDvdEdit (records not filtered). My
Primary
Key is DvdMovieID.
Thanks,
James