|
-
Nov 30th, 2004, 09:16 AM
#1
Thread Starter
New Member
Change object in another form?
Hello there,
In Access i have made several forms. But there is one form that stays on the foreground all the time, called frmGeopend. On that form i have a label, called lblInventarisatie. That label is invisible. Now i want that label to be visible as soon as i opened the form frmInventarisatie. And when i close lblInventarisatie the label on frmGeopend must be invisible again. I tried te follow code:
frmInventarisatie:
VB Code:
Private Sub Form_Load()
Form_frmGeopend.lblInventarisatie.visible = true
End Sub
Private Sub Form_unLoad()
Form_rmGeopend.lblInventarisatie.visible = false
Too bad that this code doesn't work
does somenody know how to solve this problem.
thanx
Bubani
-
Nov 30th, 2004, 11:46 AM
#2
New Member
Try this
Code:
Private Sub Form_Load()
Forms(frmGeopend).lblInventarisatie.visible = true
End Sub
Private Sub From_Unload()
Forms(frmGeopend).lblInventarisatie.visible = false
End Sub
-
Nov 30th, 2004, 09:28 PM
#3
Another syntax style...
VB Code:
Forms![frmGeopend]![lblInventarisatie].Visible
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 1st, 2004, 02:53 AM
#4
Thread Starter
New Member
Doesn't work
Hey there thanks for your reply's but they still don't work.
I tried this:
VB Code:
Forms![frmGeopend]![lblInventarisatie].Visible
and this:
VB Code:
Private Sub Form_Load()
Forms(frmGeopend).lblInventarisatie.visible = true
End Sub
Private Sub From_Unload()
Forms(frmGeopend).lblInventarisatie.visible = false
End Sub
but neither the 1st or the 2nd worked. I'm very sad about it, maybe there is another way to do this?
Or could it be some settings?
-
Dec 1st, 2004, 05:46 AM
#5
The following code works fine for me, it may be that the event you're placing the code in isn't being fired.
Create a new access database & create 2 forms.
Form1 should have a button & a label, & the button should have this code:
VB Code:
Private Sub Command1_Click()
DoCmd.OpenForm "Form2"
Me.Label1.Visible = True
End Sub
Form2 should just be blank or have a standard label on. The form's code should contain this:
VB Code:
Private Sub Form_Unload(Cancel As Integer)
Forms!Form1!Label1.Visible = False
End Sub
-
Dec 1st, 2004, 12:21 PM
#6
The order of operations for a form are:
Loading:
1.) Form_Open
2.) Form_Load
3.) Form_Resize
4.) Form_Acitvate
5.) Form_Current
Unloading:
1.) Form_Unload
2.) Form_Close
Maybe you may have some code in an event that fires after the
Form_Load event changing the label visibility to false after you
had changed it to true?
HTH
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|