R
Rachel
Hi, I am trying to goto a specific record in a form afterI have
requeried the form but unfortunately the code errors.
This is really geting to me, I've been trying to sort this for days
now so any help would be greatly appreciated. The error mssage is:
"Arguments are of wrong type, are out of acceptable range, or are in
conflict with one another"
This is my code:
(txt_NSS is a textbox on the form which displays the current Patient
ID)
(NSS_Number is the name of the id field from the record source)
Private Sub cmd_Add_Case_Click()
On Error GoTo Err_cmd_Add_Case_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim tbNSS As String
tbNHS = Me.txt_NSS '* stores patient PK *
stDocName = "frm_AddCase"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmd_Add_Case_Click:
Forms!frm_SearchPatient.Requery
With Me.RecordsetClone
..MoveFirst
..Find "NSS_Number = " & tbNSS '* this is where it errors *
..Close
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With
Exit Sub
Err_cmd_Add_Case_Click:
MsgBox Err.Description
Resume Exit_cmd_Add_Case_Click
End Sub
requeried the form but unfortunately the code errors.
This is really geting to me, I've been trying to sort this for days
now so any help would be greatly appreciated. The error mssage is:
"Arguments are of wrong type, are out of acceptable range, or are in
conflict with one another"
This is my code:
(txt_NSS is a textbox on the form which displays the current Patient
ID)
(NSS_Number is the name of the id field from the record source)
Private Sub cmd_Add_Case_Click()
On Error GoTo Err_cmd_Add_Case_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim tbNSS As String
tbNHS = Me.txt_NSS '* stores patient PK *
stDocName = "frm_AddCase"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmd_Add_Case_Click:
Forms!frm_SearchPatient.Requery
With Me.RecordsetClone
..MoveFirst
..Find "NSS_Number = " & tbNSS '* this is where it errors *
..Close
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With
Exit Sub
Err_cmd_Add_Case_Click:
MsgBox Err.Description
Resume Exit_cmd_Add_Case_Click
End Sub