J
Joe Miller
I have a database that when you are viewing a patient you
cna click on "medical History" and it will display that
form, however, I need the same patient I am viewing to
com eup right away, with access to all of the other
patients still ( no filter). I can code it so that the
only patient left is the one viewed, but then I can't
scroll through the others. I need the curren tone to come
up, but with access to the others.
I was given this code for a 'non-filtering' option,
however, the third line will not be accepted, any other
ideas?
Private Sub ButtonName_Click()
On Error Goto Err_Sub
Dim rst As DAO.Recordset
stDocName = "YourFormName"
stLinkCriteria = stLinkCriteria = "[Patient Number]="
& "'" & Me![Acct
#] & "'"
DoCmd.OpenForm stDocName 'Do Not Supply Link
Criteria Here
Set rst = Forms!YourFormName.RecordsetClone
rst.FindFirst stLinkCriteria 'Link
Criteria goes here
If rst.EOF Then
MsgBox "Record not found"
Else
Me.Recordset.Bookmark = rst.Bookmark
End If
Exit_Sub:
On Error Resume Next
rst.close
Set rst = Nothing
Err_Sub:
MsgBox Err.Description
Resume Exit_Sub
End Sub
Thanks! Joe
cna click on "medical History" and it will display that
form, however, I need the same patient I am viewing to
com eup right away, with access to all of the other
patients still ( no filter). I can code it so that the
only patient left is the one viewed, but then I can't
scroll through the others. I need the curren tone to come
up, but with access to the others.
I was given this code for a 'non-filtering' option,
however, the third line will not be accepted, any other
ideas?
Private Sub ButtonName_Click()
On Error Goto Err_Sub
Dim rst As DAO.Recordset
stDocName = "YourFormName"
stLinkCriteria = stLinkCriteria = "[Patient Number]="
& "'" & Me![Acct
#] & "'"
DoCmd.OpenForm stDocName 'Do Not Supply Link
Criteria Here
Set rst = Forms!YourFormName.RecordsetClone
rst.FindFirst stLinkCriteria 'Link
Criteria goes here
If rst.EOF Then
MsgBox "Record not found"
Else
Me.Recordset.Bookmark = rst.Bookmark
End If
Exit_Sub:
On Error Resume Next
rst.close
Set rst = Nothing
Err_Sub:
MsgBox Err.Description
Resume Exit_Sub
End Sub
Thanks! Joe