How to hide / show MS Access DB form using vb.net

If the form in the access database is set as hidden. Then how to show it? so that we can manipulate the form programmatically using vb.net.

Thank.

0


source to share


4 answers


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

      

+1


source


Remou's code should work to display invisible forms whose properties have been changed in HIDDEN in the access UI.

In VBA, to simplify Remou's example, it would be:

SetHiddenAttribute acForm, "MyHiddenForm", False 

      

You might need to automate access with VB.NET to accomplish this, but SetHiddenAttribute is a top-level method of the Access application object, so it should be fairly straightforward to use. The VBA value with a constant constant acForm is 2, so you probably have to call it literally, something like this:

app.Application.SetHiddenAttribute 2, "MyHiddenForm", False

      



where the application object was initialized as an Access application. Dunno, as it is 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 just be app.SetHiddenAttribute, but you can easily try any of them.

But keep in mind, it was Remu who gave the correct answer. I'm just thinking about how to get it to work in a programming environment that I don't even use!

+1


source


Does the form have a visible property? You can set to true to make the view visible.

0


source


Do you mean that the form is open but not visible, or that the meta-form properties of the meta-form are not displayed? You have nothing to do later, as items installed with visible disabled will be removed the next time the database is compressed.

0


source







All Articles