I have a switchboard button (edit/delete) or (print) that I want to program to ask what policy number before opening up the form or report so that it opens up that certain policy.
You could use the following code in the AfterUpdate event of a combo box that shows the user all legitimate policy numbers.
Dim lngSID As Long
Const conCannotGoToRecord = 2105
If Not IsNull(cmbFind) Then
lngSID = Me.cmbFind
Me.RecordsetClone.FindFirst "[ServId] = " & lngSID
Me.Bookmark = Me.RecordsetClone.Bookmark
Me.cmbFind.Value = Null
Else
Me.cmbFind.Value = Null
Exit Sub
End If
This assumes a long integer for policy number - FindFirst would changer for a string
something like "[ServId] = "'& strSID & "'"
you would want to account for user entry 'not in list' (see Access help), etc. You could also run code from a button instead of afterUpdate of combo box. Hope this helps.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.