If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Two way communication between forms. No tables.
I need to make a generic "override form." It will be used anywhere someone
has to deviate from normal procedures. I want it to work like a message box but I need to be able to pass two values, a message, and a "password" for the particular level. When a response is entered I want to pass back pass/fail or the response so I can check it. I keep coming up short on ideas and played all day trying to get something to work. Please make me look stupid and show me what I'm Missing!!!!! |
#2
|
|||
|
|||
Two way communication between forms. No tables.
On Fri, 28 Jul 2006 15:10:19 -0700, Ynot wrote:
I need to make a generic "override form." It will be used anywhere someone has to deviate from normal procedures. I want it to work like a message box but I need to be able to pass two values, a message, and a "password" for the particular level. When a response is entered I want to pass back pass/fail or the response so I can check it. I keep coming up short on ideas and played all day trying to get something to work. Please make me look stupid and show me what I'm Missing!!!!! You can pass the message and the password using the openform OpenArgs argument. The second form reads the message and if the password is correct, displays the message in the LabelName label control. From Form1: Docmd.OpenForm "Form2", , , , , ,"This is your Message/ThePAssWoRd$*" In the Form2 Load event: If Not IsNull(Me.OpenArgs) Then Dim strMessage as String Dim strPassword as String strMessage = Left(Me.OpenArgs,InStr(Me.OpenArgs,"/")-1) strPassword = Mid(Me.OpenArgs,InStr(Me.OpenArgs,"/")+1) If strPassword = InputBox("Enter the Password") Then Me.LabelName.Caption = strMessage Else MsgBox "You don't have authority to view this form." DoCmd.Close acForm, Me.Name End If End If You can use the same method to pass back to Form1 any information you wish. You might want to consider another unbound form to use in place of the InputBox so that you can use an unbound control with a Password Input Mask to hide the entered password. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#3
|
|||
|
|||
Two way communication between forms. No tables.
OK, I understand that part and use the parse the OpenArgs but how do I pas
back pass/fail??? "fredg" wrote in message .. . On Fri, 28 Jul 2006 15:10:19 -0700, Ynot wrote: I need to make a generic "override form." It will be used anywhere someone has to deviate from normal procedures. I want it to work like a message box but I need to be able to pass two values, a message, and a "password" for the particular level. When a response is entered I want to pass back pass/fail or the response so I can check it. I keep coming up short on ideas and played all day trying to get something to work. Please make me look stupid and show me what I'm Missing!!!!! You can pass the message and the password using the openform OpenArgs argument. The second form reads the message and if the password is correct, displays the message in the LabelName label control. From Form1: Docmd.OpenForm "Form2", , , , , ,"This is your Message/ThePAssWoRd$*" In the Form2 Load event: If Not IsNull(Me.OpenArgs) Then Dim strMessage as String Dim strPassword as String strMessage = Left(Me.OpenArgs,InStr(Me.OpenArgs,"/")-1) strPassword = Mid(Me.OpenArgs,InStr(Me.OpenArgs,"/")+1) If strPassword = InputBox("Enter the Password") Then Me.LabelName.Caption = strMessage Else MsgBox "You don't have authority to view this form." DoCmd.Close acForm, Me.Name End If End If You can use the same method to pass back to Form1 any information you wish. You might want to consider another unbound form to use in place of the InputBox so that you can use an unbound control with a Password Input Mask to hide the entered password. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
Thread Tools | |
Display Modes | |
|
|