Hi:
Can't quite get this to work -- am getting Error Msg 3070 -- The Jet
Engine does not recognize FK_Fees as valid.
That is in fact the field name in tblRevisionHistory:
Private Sub BeginCode()
On Error GoTo Error_Handler:
Dim frm As Form
DoCmd.OpenForm "frmRevisionHistory" 'Let's make sure it is open.
Set frm = Forms("frmRevisionHistory")
RecordsetClone.FindFirst "[FK_Fees] = " & Me![PK_Fees]
If frm.RecordsetClone.NoMatch Then
MsgBox "Sorry, no History record exists."
Else
frm.Bookmark = frm.RecordsetClone.Bookmark
frm.SetFocus
End If
Set frm = Nothing
Exit Sub
Error_Handler:
MsgBox Err.Description & " " & Err.Number & "NO RELATED REC!"
End Sub
Thanks!!!
===
"Jim Allensworth" <ji****@Notdatacentricsolutions.com> wrote in message news:<40**************@news.west.earthlink.net>...
Use the RecordsetClone of the form that you want to check. You can use
its Find method to look for the record. Along the lines of...
Dim frm As Form
DoCmd.OpenForm "frm2" 'Let's make sure it is open.
Set frm = Forms("frm2")
RecordsetClone.FindFirst "FK_ID=" & Me.PK_ID
If frm.RecordsetClone.NoMatch Then
MsgBox "Record Not Found!"
Else
frm.Bookmark = frm.RecordsetClone.Bookmark
frm.SetFocus
End If
Set frm = Nothing
- Jim
On 2 Jul 2004 11:19:58 -0700, am*******@verizon.net (amywolfie) wrote:
Is there a simple way to code:
If (no related records)
in VBA?
I would be going from frmMain to frm2, where frm2 may or may not have
a related record.
I do have a PK_ID in frmMain and a FK_ID in frm2.
Thanks!
amy
=---