If a form in Access DB is set as hidden. Then how to unhide it? so that we can manipulate the form programmentically using vb.net.
Thank you.
If a form in Access DB is set as hidden. Then how to unhide it? so that we can manipulate the form programmentically using vb.net.
Thank you.
Does the form have Visible property? You can set to true to make the form visible.
I cannot help with .net, in VBA:
Sub FormHidden()
Dim frm
For Each frm In CurrentProject.AllForms
SetHiddenAttribute acForm, frm.Name, False
Next
End Sub
Do you mean the form is open but not visible, or that the form's meta properties are set to not visible? The later is something you shouldn't do, as items set with visible off will be deleted the next time the database is compacted.
--
David W. Fenton
David Fenton Associates
The code Remou gave should work for unhiding forms whose properties have been changed to HIDDEN in the Access UI.
In VBA, to simplify Remou's example, that would be:
SetHiddenAttribute acForm, "MyHiddenForm", False
You may be required to automate Access from VB.NET in order to accomplish this, but SetHiddenAttribute is a method of the top-level Access application object, so ought to be fairly simple to use. The value of the VBA named constant acForm is 2, so you'd likely have to call that literally, something like this:
app.Application.SetHiddenAttribute 2, "MyHiddenForm", False
where the app object has been initialized as an Access application. Dunno how that's done in VB.NET, but in VBA it would be something like:
Set app = CreateObject("Access.Application")
I'm not sure if the correct syntax would be app.Application.SetHiddenAttribute or if it would be just app.SetHiddenAttribute, but you could easily try either one.
But keep in mind, it was Remou who gave the correct answer. I'm only speculating on how to make it work in a programming environment I don't even use!
--
David W. Fenton
David Fenton Associates