Hmmmmmm, why are you using the OpenArgs parameter?? Is there code in "frmBookRegister" to move to the specified record when "frmBookRegister" opens?
It would be easier to use the WHERE parameter
Code:
DoCmd.OpenForm "frmBookRegister", , , "pkBookId = " & strWhere
or (using named parameters)
Code:
DoCmd.OpenForm "frmBookRegister", WHERE:="pkBookId = " & strWhere
What is the data type of Me.pkBookId? The suffix "ID" implies Me.pkBookId is a Number.
Why is strWhere declared as a string?
Code:
Private Sub cmdCheckOut_Click()
On Error GoTo ProcError
Dim strWhere As String
strWhere = Me.pkBookId
' DoCmd.OpenForm "frmBookRegister", OpenArgs:="pkBookId = " & strWhere
' DoCmd.OpenForm "frmBookRegister", WHERE:="pkBookId = " & strWhere
DoCmd.OpenForm "frmBookRegister", , , "pkBookId = " & strWhere
ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description & ", " _
& vbCritical, "Error in cmdCheckOut_Click Procedure..."
Resume ExitProc
End Sub