Can anyone help me? I'm not too familiar with VB, plus it's been a while since I wrote this code.
I believe that the strInput_User_Name is loosing its value as the user uses the program throughout the day. The InputBox launches whenever the database is opened. If the user does not enter his/her name, then the switchboard form is closed. The value in strInput_User_Name is recorded in different fields throughout my database whenever data is added or modified on a form.
Public Function Input_User_Name()
Dim MsgResult
DoCmd.RunMacro "mcrMAXIMIZE"
MsgResult = vbNo
Input_User_Name = InputBox("Please enter your name.", "EIB Contact Management System")
If Input_User_Name = "" Then
Do Until Input_User_Name <> ""
Input_User_Name = InputBox("You MUST enter your name before continuing. Please enter your name.", "EIB Contact Management System")
If Input_User_Name = "" Then
MsgResult = MsgBox("Quit EIB System?", vbYesNo + vbQuestion)
If MsgResult = vbYes Then
strCloseSwitchboard = "1"
DoCmd.Close acForm, "Switchboard"
Exit Do
End If
End If
Loop
Else: strInput_User_Name = Input_User_Name
'above line added 5/14/01
End If
'strInput_User_Name = Input_User_Name
'This should be done outside of the function since Input_User_Name itself caries the value - this line is redudant here
End Function
According to the code that has been written, will strInput_User_Name always store some value, except for null?
Someone here on the forum helped me with writing this code. There is a comment saying that "strInput_User_Name = Input_User_Name should be done outside the function"? Is this true?
Please let me know if I need to clarify.
Thanks!
[This message has been edited by crhodus (edited 08-24-2001).]
I believe that the strInput_User_Name is loosing its value as the user uses the program throughout the day. The InputBox launches whenever the database is opened. If the user does not enter his/her name, then the switchboard form is closed. The value in strInput_User_Name is recorded in different fields throughout my database whenever data is added or modified on a form.
Public Function Input_User_Name()
Dim MsgResult
DoCmd.RunMacro "mcrMAXIMIZE"
MsgResult = vbNo
Input_User_Name = InputBox("Please enter your name.", "EIB Contact Management System")
If Input_User_Name = "" Then
Do Until Input_User_Name <> ""
Input_User_Name = InputBox("You MUST enter your name before continuing. Please enter your name.", "EIB Contact Management System")
If Input_User_Name = "" Then
MsgResult = MsgBox("Quit EIB System?", vbYesNo + vbQuestion)
If MsgResult = vbYes Then
strCloseSwitchboard = "1"
DoCmd.Close acForm, "Switchboard"
Exit Do
End If
End If
Loop
Else: strInput_User_Name = Input_User_Name
'above line added 5/14/01
End If
'strInput_User_Name = Input_User_Name
'This should be done outside of the function since Input_User_Name itself caries the value - this line is redudant here
End Function
According to the code that has been written, will strInput_User_Name always store some value, except for null?
Someone here on the forum helped me with writing this code. There is a comment saying that "strInput_User_Name = Input_User_Name should be done outside the function"? Is this true?
Please let me know if I need to clarify.
Thanks!
[This message has been edited by crhodus (edited 08-24-2001).]