Solved How can I Hide Access And only view Forms (1 Viewer)

you can just have one 'master' form with your options on it and a large subform control. Depending on which option is selected, set the subform sourceobject to your form name rather than using docmd.openform

so when your main form opens, set the subform sourceobject to "" and perhaps hide it as well, then assign the form you want opened to the sourceobject and open if hidden once somethign is selected

for example instead of

Code:
dim wStr as String
dim fName as string

wStr="PK=" & cboCustomerPK
fname=cboFormToOpen

docmd.OpenForm fname,,,wStr

The openform parameters won't be available but you can instead refer to variables on the main form if required

Code:
dim wStr as String
dim fName as string

wStr="PK=" & cboCustomerPK
fname=cboFormToOpen

mySubformname=fname
mySubformname.form.filter=wStr
mySubformname.form.filteron=true
 
I know this is an old topic, but I'm hoping your idea will work for the database I've been developing. And it does, up to a point. I just need a little help getting over that roadblock.

My DB opens to frmBackground, which is exactly what it sounds like: a maximized empty form that I want to stay open behind my other forms. frmBackground opens frmMenu which only contains an option group for selecting other forms to open. Although frmMenu opened, it stayed behind frmBackground and I don't know why.

In the process of searching for an answer, I came upon your idea and it sounded like a great solution for this project, since all my forms are the same size. So I placed an unbound subform in the center of frmBackground and succeeded in opening frmMenu in there with this line:

Forms(gstrMasterForm).Controls(gstrMasterSubform).SourceObject = strOpenForm

Yeayy! Success, I thought... for about five seconds. Until I realized that nothing happens when I select any of the option buttons on the Menu. The buttons stay white and frmMenu stays in the subform. What am I missing?
 
I know this is an old topic, but I'm hoping your idea will work for the database I've been developing. And it does, up to a point. I just need a little help getting over that roadblock.

My DB opens to frmBackground, which is exactly what it sounds like: a maximized empty form that I want to stay open behind my other forms. frmBackground opens frmMenu which only contains an option group for selecting other forms to open. Although frmMenu opened, it stayed behind frmBackground and I don't know why.

In the process of searching for an answer, I came upon your idea and it sounded like a great solution for this project, since all my forms are the same size. So I placed an unbound subform in the center of frmBackground and succeeded in opening frmMenu in there with this line:

Forms(gstrMasterForm).Controls(gstrMasterSubform).SourceObject = strOpenForm

Yeayy! Success, I thought... for about five seconds. Until I realized that nothing happens when I select any of the option buttons on the Menu. The buttons stay white and frmMenu stays in the subform. What am I missing?
Hi. Welcome to AWF!

Since this is an old discussion, you might consider starting a new one and simply refer to this thread if you want others to consider what was discussed here before. Are you using Popup forms? If not, maybe try using them? Good luck.
 
Hi. Welcome to AWF!

Since this is an old discussion, you might consider starting a new one and simply refer to this thread if you want others to consider what was discussed here before. Are you using Popup forms? If not, maybe try using them? Good luck.
Since I was specifically referring to CJ_London's idea, I didn't think it was appropriate to start a new thread at this point. Maybe I should have quoted his post to make that clear?

I hadn't tried Popup forms yet. I wasn't sure whether they would be appropriate for this purpose. I basically have three forms for data maintenance and one form for searching/filtering the data (besides the background and menu forms, of course). Three of these forms have one or two subforms.
 
Since I was specifically referring to CJ_London's idea, I didn't think it was appropriate to start a new thread at this point. Maybe I should have quoted his post to make that clear?

I hadn't tried Popup forms yet. I wasn't sure whether they would be appropriate for this purpose. I basically have three forms for data maintenance and one form for searching/filtering the data (besides the background and menu forms, of course). Three of these forms have one or two subforms.
It was just a suggestion we tend to give when an old thread gets resurrected by new members. I'm not trying to stop you from continuing on in this thread, which was started by khodor. So, if your inquiries are aimed to further his quest; then by all means, all contributions are welcome.

But if you think there's any chance your topic is slightly different than his, then I'd sill humbly recommend that you start your own thread. You can always reference any previous posts or discussions in your thread, if additional background info is necessary.

Cheers!
 
It was just a suggestion we tend to give when an old thread gets resurrected by new members. I'm not trying to stop you from continuing on in this thread, which was started by khodor. So, if your inquiries are aimed to further his quest; then by all means, all contributions are welcome.

But if you think there's any chance your topic is slightly different than his, then I'd sill humbly recommend that you start your own thread. You can always reference any previous posts or discussions in your thread, if additional background info is necessary.

Cheers!
I guess you might say that my question is a natural extension of the original question. I came to this thread because I had the same question khodor was asking. At the end of the thread I found CJ_London's idea, which I wanted to try. So unless you found that post to be off topic, I don't think mine is.

I do wonder, though, about how the forum works. I think I might have posted without klicking Reply on CJ_London's post. Would he or she even be aware that I'm asking about that post?
 
I do wonder, though, about how the forum works. I think I might have posted without klicking Reply on CJ_London's post. Would he or she even be aware that I'm asking about that post?
Even if you did click the Reply button, that's not a guarantee CJ would see your reply, if he is not subscribed to this thread (but more than likely he is though). One other way to call a member's attention is to tag them, for example, @CJ_London. Luckily, CJ is still very active here, so they should get that tag message soon. Otherwise, in an old thread, there's no guarantee all original participants are still available to respond. Good luck!
 
So I placed an unbound subform in the center of frmBackground and succeeded in opening frmMenu in there with this line:
Forms(gstrMasterForm).Controls(gstrMasterSubform).SourceObject = strOpenForm
Yeayy! Success, I thought... for about five seconds. Until I realized that nothing happens when I select any of the option buttons on the Menu. The buttons stay white and frmMenu stays in the subform. What am I missing?
hard to say without seeing your full code - what and where are the option buttons? if your unbound subform (control?) is in a form called frmBackground but your code refers to a qstrMasterForm.

And would have thought all you need is

gstrMasterSubform.SourceObject = strOpenForm

if your code is in the same form as your subform
 
hard to say without seeing your full code - what and where are the option buttons? if your unbound subform (control?) is in a form called frmBackground but your code refers to a qstrMasterForm.

And would have thought all you need is

gstrMasterSubform.SourceObject = strOpenForm

if your code is in the same form as your subform
Thanks for responding. I have two global variables: gstrMasterForm and gstrMasterSubform. The subform is on frmBackground and frmMenu only contains an option group for selecting other forms to open in that subform.

In frmBackground I have the following:
Code:
  Private Sub Form_Load()
    gstrMasterForm = "frmBackground"
    gstrMasterSubform = "sbfMaster"
  End Sub

  Private Sub Form_Current()
    Dim strOpenForm As String
    strOpenForm = "frmMenu"

    Controls(gstrMasterSubform).SourceObject = strOpenForm
  End Sub

In frmMenu I have something like this:
Code:
Private Sub grpChooseTask_AfterUpdate()
  Dim strOpen As String
  
  Select Case Me!grpChooseTask
    Case 1
      strOpen = "frmForm1"
    Case 2
      strOpen = "frmForm2"
  End Select
  
  Forms(gstrMasterForm).Controls(gstrMasterSubform).SourceObject = strOpen
  Me!grpChooseTask = 0
  DoCmd.Close acForm, "frmMenu", acSaveNo
End Sub

 
seems a convoluted way of doing things. I mocked up your code and get errors so cannot really advise.

I would say using the form current event can cause issues since whatever was in the subform control will be replaced every time it fires.

Controls(gstrMasterSubform).SourceObject = strOpenForm

and if frmMenu is being used within the subform control, this line will have no effect

DoCmd.Close acForm, "frmMenu", acSaveNo

The way I would do it is have your menu form along one edge of frmBackground (either side, top or bottom) with your subform control adjacent, or size and locate to the same location of your subform control and use the subform controls visible property as required.
 
The way I would do it is have your menu form along one edge of frmBackground (either side, top or bottom) with your subform control adjacent, or size and locate to the same location of your subform control and use the subform controls visible property as required.
I don't understand why you think it would make a difference where frmMenu is located. None of the forms work if I place them in the subform. They will display and I can navigate records, but I can't select anything in an option group or combobox or type anything in a textbox. I assume you have tried this approach successfully. How did you make it work?

When you say "use the subform controls visible property", do you mean all opened forms should remain open but invisible at all times and never closed? Is that advisable? Before I tried your idea, I would use frmMenu to open one of the other forms. They would then default to opening frmMenu again when they were closed so I could select a different form.
 
I don't understand why you think it would make a difference where frmMenu is located. None of the forms work if I place them in the subform. They will display and I can navigate records, but I can't select anything in an option group or combobox or type anything in a textbox. I assume you have tried this approach successfully. How did you make it work?
The question is not "how CJ_London made it work", the question is "what did you do to make it not work." This is a very common approach, done all the time, so you done something to make it not work. Hard to say what you are doing wrong without seeing it. Sounds as if you simply set allow edits to false for all the subforms.
 
The question is not "how CJ_London made it work", the question is "what did you do to make it not work." This is a very common approach, done all the time, so you done something to make it not work. Hard to say what you are doing wrong without seeing it. Sounds as if you simply set allow edits to false for all the subforms.
Well, that's exactly the question I'm asking. The only thing I did was make a new "master" form with a subform control on it, then "set the subform sourceobject to your form name rather than using docmd.openform", as CJ_London instructed. There must be more to it than that, and I'm trying to find out what that is. All the previously existing forms allow edits. Without this approach, everything works perfectly.
 
Can you upload a version of the DB? We are kind of guessing if not.
 
Well, since all I'm getting is negative comments and no actual help, I give up on this idea. Earlier posts in this thread were helpful in hiding the application, though, so I don't completely regret joining the forum.
 
I must be missing something as I haven't seen any negative comments since your first post. The various requests for additional information so people can help you are not in any way negative.
 

Users who are viewing this thread

Back
Top Bottom