Auto fill field when form opens w/ value from previous form

P

Pamela

I have cboAdjusterID on a data entry form, frmClaim, with NotInList event
that opens frmAdjuster. When the event fires, I would like to have the
system auto carry the value of another field, InsuranceID, into the CompanyID
field on the frmAdjuster. I'm listing my current code for this below just in
case. It seems like it should be simple enough, but none of the things I've
tried has worked and I'm so new to Access. Any help on how to accomplish
this would be great! Thanks!

Private Sub cboAdjusterID_NotInList(NewData As String, Response As Integer)
If MsgBox(NewData & " is not in the list." & vbCrLf & "Would you like to add
" & NewData & "?", vbQuestion + _
vbYesNo + vbDefaultButton2, "Not Found") = vbYes Then

Me.InsuranceCoID.Value.Copy
DoCmd.OpenForm "frmAdjuster", acFormAdd, acDialog
CompanyID.Paste
Response = acDataErrAdded
Me.Requery
With Me.RecordsetClone

.FindFirst [AdjusterID] = " & NewData & """
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With
Else
Me.cboAdjusterID.Undo

Response = acDataErrContinue
End If
End Sub
 

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