Pop-Up vs Embedded Hidden Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear Group

I've got my dbase completed (whew!) and now want to give it that professional look. My main form, called "Inventory" has a lot of buttons on it that when depressed, open up pop-up forms. For example, while in the "Inventory" main form, the user may want to add a new building to the inventory list. He clicks the "edit buildings" button and the "Buildings" pop-up form comes up. Pop-ups are cool but I think there is a way to make things more professional but don't know how.

I know how to specify the position of the form on load but that's not what I want. Ideally, I would like the main form "Inventory" to contain a picture on the right side of the screen. When the user in my example clicks the "edit buildings" button, instead of the "Buildings" pop-up coming up, the picture on the "Inventory" main form disappears and the "Buildings" form shows up, all on one form (or appears to the user to be happening on one form). When the user clicks the close or done button of the now visible subform, the subform would turn back to invisible and the picture would pop back up again in its place. Is this too complicated? Any help would be greatly appreciated. Thanks.
 
You should be able to do it using subforms.

Create a subform with your picture on it, and add it to the main form. That
will create a subform object on your main form. When it's first created, the
subform object will have the same name as the form that's the subform (I
hope that makes sense!). My advice would be to change the name of the
subform object, to avoid confusion later on.

Now, all you should need to do is change the SourceObject property of the
subform object to point to another form instead of your picture form. You'll
probably also have to change the subform object's LinkChildFields and
LinkMasterFields properties.

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Mboozer said:
Dear Group:

I've got my dbase completed (whew!) and now want to give it that
professional look. My main form, called "Inventory" has a lot of buttons on
it that when depressed, open up pop-up forms. For example, while in the
"Inventory" main form, the user may want to add a new building to the
inventory list. He clicks the "edit buildings" button and the "Buildings"
pop-up form comes up. Pop-ups are cool but I think there is a way to make
things more professional but don't know how.
I know how to specify the position of the form on load but that's not what
I want. Ideally, I would like the main form "Inventory" to contain a picture
on the right side of the screen. When the user in my example clicks the
"edit buildings" button, instead of the "Buildings" pop-up coming up, the
picture on the "Inventory" main form disappears and the "Buildings" form
shows up, all on one form (or appears to the user to be happening on one
form). When the user clicks the close or done button of the now visible
subform, the subform would turn back to invisible and the picture would pop
back up again in its place. Is this too complicated? Any help would be
greatly appreciated. Thanks.
 
Thanks Doug. Worked great excpet for one thing. This one had me banging my head all day and I really really tried. I had a pop-up form (Notes) that was linked to a subform (ChemLocation) on my main form (Inventory). When I discovered the visible/not visible routine, I wanted to do away with the pop-up form (Notes). When Notes was a pop-up form, the only way to link it to subform ChemLocation was with the following code on click of the Notes button on the Inventory form

DoCmd.OpenForm "Notes", , , "[IDBarCodeData] = " & Me.[IDBarCodeData

Now that I have made this pop-up into an invisible subform on the main Inventory form, I installed the following code

Forms!ChemicalInventory.Notes.Visible = Tru

I still need to link the key fields “IDBarCodeData†after the “Notes†subform goes visible. In other words, I need to get rid of the DoCmd.OpenForm part of the expression and somehow marry it with the visible = true expression. I don’t know the syntax and can’t find it but what I wants looks sort of like this without the DoCmd because I do not want two instances of the same form, a pop-up and a visible form

Forms!ChemicalInventory.Notes.Visible = Tru
DoCmd.OpenForm "Notes", , , "[IDBarCodeData] = " & Me.[IDBarCodeData

I tried the Link Child/Master wizard but it doesn’t work for a subform referencing another subform on a main form. I saw some postings about entering the full string in the link statement but I don’t know if this is sql or vb and even if I did, I wouldn’t know where to put it. The above vb code worked great for the pop-up and should work for the visible method if I could only figure out the right syntax. Help! Thanks
 
Back
Top