View Single Post
  #6 (permalink)  
Old February 19th, 2004, 12:12 PM
bph bph is offline
Friend of Wrox
 
Join Date: Dec 2003
Location: , , .
Posts: 102
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Excellent...
Here's what I ended up with. I incorporated your thoughts into the final product. If the user doesn't enter initials they go nowhere. If they enter initials that don't match the initials in a table that sits behind the initial field on the form, then I let the form open and they can't proceed until they select their initials from a drop down box.
Now....FYI- this is a data entry form. I want this same input box routine to run after a user has saved their entries, and moved to input data in the next record. So They save, next blank form appears and boom, the have to enter their initials.

I tried the "after insert" event, and the "after update" event. The input box pops up too early, before the next blank record is viewed. Want to see the next blank record, then prompt for initials.

Make sense? Where do I stick this code to make that happen?

****************************
Private Sub Form_Open(Cancel As Integer)
On Error GoTo NoInitialsEntered
Dim varInitials As Variant
   varInitials = InputBox("Please enter your initials.", "User Initials")
   If varInitials = "" Then
   DoCmd.Close acForm, "add_frm_lake_pipeinfo", acSaveNo
   Else
   Me.cboLake_Person_Last_Updated.SetFocus
   Me.cboLake_Person_Last_Updated.Text = (varInitials)
   End If
NoInitialsEntered:
    Select Case Err.Number
        Case 2237
            MsgBox "The initials entered are not valid"
            Exit Sub
        End Select
End Sub

Reply With Quote