I have the form set to "Data Entry" but for some reason when the form opens to the first record to input instead of (New).
What that means is... if I try to leave the form... I get the error "you must enter a value in the 'name' field".
I have to hit (esc) button to clear everything out and my users aren't smart enough to do this!!!
Here is the VBA that runs on this page. Is there something that is causing this to occur?
Code:
Option Compare Database
Option Explicit
Private blnGood As Boolean
-------------------------------------------------
Private Sub FindFileInput_Click()
Dim f As Object
Dim strSelectedpath As String
Dim strSelectedFile As String
Dim varItem As Variant
Set f = Application.FileDialog(3)
f.AllowMultiSelect = False
If f.Show = -1 Then
For Each varItem In f.SelectedItems
strSelectedpath = varItem & "#" & varItem
strSelectedFile = Split(strSelectedpath, "\")(UBound(Split(strSelectedpath, "\")))
Next varItem
Me![txtSelectedFile] = strSelectedpath
Me![txtFileName] = strSelectedFile
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "File association successful"
Style = vbOKOnly + vbInformation + vbDefaultButton1
Title = "Association"
Help = "DEMO.HLP"
Ctxt = 1000
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then ' User chose Yes.
MyString = "Done" ' Perform some action.
End If
End If
Set f = Nothing
End Sub
-------------------------------------------------
Private Sub Form_Current()
If Me.NewRecord Then
CreateBy = Environ("username")
End If
End Sub
-------------------------------------------------
Private Sub Form_Open(Cancel As Integer)
If User.AccessID = 4 Then
MsgBox "You are not authorized to open this form!", vbOKOnly + vbExclamation
Cancel = True
End If
End Sub