A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Two way communication between forms. No tables.



 
 
Thread Tools Display Modes
  #1  
Old July 28th, 2006, 11:10 PM posted to microsoft.public.access.forms
Ynot
external usenet poster
 
Posts: 5
Default 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  
Old July 29th, 2006, 12:38 AM posted to microsoft.public.access.forms
fredg
external usenet poster
 
Posts: 4,386
Default 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  
Old July 29th, 2006, 12:51 AM posted to microsoft.public.access.forms
Ynot
external usenet poster
 
Posts: 5
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:00 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.