Add New Record

  • Thread starter Thread starter Zanstemic
  • Start date Start date
Z

Zanstemic

This is for a Create Record Button:

The button is on the main form Authorization and it creates a new record for
Trip Report. These records are related through AuthorizationID.

The intent is to create a NEW RECORD in Trip Report if one has not been
added or OPEN an existing record with the same AuthorizationID it already
exists.

Any suggestions are appreciated.
 
After the form opens, I'm trying the following in the Load Event of the form

Dim lngID As Long
If Len(Trim(Nz(Me.txtAuthorizationID, ""))) > 0 Then
lngID = CLng(Me.txtAuthorizationID)
If lngID <> 0 Then
Me.RecordsetClone.FindFirst "AuthorizationID=" & lngID
If Not Me.RecordsetClone.NoMatch Then
Me.Bookmark = Me.RecordsetClone.Bookmark
Else
If Not Me.NewRecord Then
DoCmd.RunCommand acCmdRecordsGoToNew
End If
End If
End If
End If

It's erroring on Me.RecordsetClone.FindFirst "AuthorizationID=" & lngID

I'm not sure if this is the best approach so any suggestions are appreciated.
 
Back
Top