Add New Record

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.
 
Z

Zanstemic

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top