By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,775 Members | 1,399 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,775 IT Pros & Developers. It's quick & easy.

How to display a current form name

100+
P: 134
I have many form with frame, it also have a condition to test whether the frame to be hidden or unhide, so instead of repeating the code in every form, I created a module like this -

If MAS00 = 1 Then
FrameMas00.Visible = True
ElseIf MAS00 = 0 Then
FrameMas00.Visible = False
End If

I call the module in the form like this -
modframe

It return me an error as it does not know this frame is belong to which form, How should I cater for all forms ?
May 1 '08 #1
Share this Question
Share on Google+
1 Reply


jeffstl
Expert 100+
P: 432
I have many form with frame, it also have a condition to test whether the frame to be hidden or unhide, so instead of repeating the code in every form, I created a module like this -

If MAS00 = 1 Then
FrameMas00.Visible = True
ElseIf MAS00 = 0 Then
FrameMas00.Visible = False
End If

I call the module in the form like this -
modframe

It return me an error as it does not know this frame is belong to which form, How should I cater for all forms ?
You will need a public function that checks a visibility true\false and returns the boolean.

Create a public function for your project and then use it where needed

Expand|Select|Wrap|Line Numbers
  1.  
  2. Function CheckFrmVisible(MyInputVar as variant) as Boolean
  3.      Select Case MyInputVar
  4.           Case 0
  5.                CheckFrmVisible = False
  6.           Case 1
  7.                CheckFrmVisible = True
  8.      End Select
  9. End Function
  10.  
  11. 'Then place this on any form where needed
  12.  
  13. FrameMas00.Visible = CheckFrmVisible(MyInputVar)
  14.  
  15.  
  16.  
May 2 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.