Results 1 to 10 of 10
  1. #1
    khayward is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Apr 2017
    Location
    Oregon
    Posts
    89

    Changing how a form appears depending on how it was opened


    Not even sure if it is possible, but I have a form that I would normally like to have open full screen when opened from a switchboard or the navigation pane, but I also may want that same form to open as a popout that isn't full screen when opened from a command button or NotInList event during data entry processes. Is it possible for the same form to appear differently based on how it was opened?

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    Depends on certain factors. Let's start with what your form view setting is (File>Options). Tabbed forms or overlapping?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Certainly.

    One way is to pass a value to form with OpenArgs.

    DoCmd.OpenForm "formname", , , "filter criteria", , , "something"

    Then use an If Then Else structure in opening form Load or Open or Current event.

    If Me.OpenArgs = "something" Then
    'do this
    Else
    'do other
    End If
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    khayward is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Apr 2017
    Location
    Oregon
    Posts
    89
    Quote Originally Posted by Micron View Post
    Depends on certain factors. Let's start with what your form view setting is (File>Options). Tabbed forms or overlapping?
    Just coming back to this after looking after people with cooties! Setting is currently tabbed documents. The scenario is this - I have a form for assemblies, which contains a bill of materials subform. Sometimes when filling out the bill of materials there will be an item that is not in the materials list and will have to be added, I want to streamline that as right now you would have to go back to the switchboard and open the materials form, which opens as another tab and has subforms of its own. I don't need the whole form and all the subforms to add something and I don't want the user to have to switch tabs a whole bunch of times, plus they would have to close and reopen the assemblies form for the new data to be available.As I'm writing this it looks like it would be good for me to design an additional form solely for adding materials and have the assemblies form requery after that's done....

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    Without seeing your db can only say that you have options but which is best?
    One would be a modal popup form where user adds the value & clicks Save & Close button. Form close code can requery the necessary forms. That sees to be what you alluded to.
    If the materials option is a combo, there is also the Not In List event.
    I take it that there is something about your design that prevents the user from simply adding a new materials record with the desired info. I also wonder why materials, which sounds like a primary thing, has a subform for it. I can't picture why, if one of the materials was steel, you would have a subform for that. But that's the drawback with not knowing what you know about this.
    Last edited by Micron; 12-15-2019 at 12:45 PM. Reason: spelin and gramur
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    khayward is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Apr 2017
    Location
    Oregon
    Posts
    89
    Quote Originally Posted by Micron View Post
    Without seeing your db can only say that you have options but which is best?

    I take it that there is something about your design that prevents the user from simply adding a new materials record with the desired info. I also wonder why materials, which sounds like a primary thing, has a subform for it. I can't picture why, if one of the materials was steel, you would have a subform for that. But that's the drawback with not knowing what you know about this.
    BCMRP1_2019-12-13.zip

    So it's got a lot of bugs at the moment. I'm in the process of running some test data through it and finding all the issues. Long story short, materials has its own main form and subforms as there are various related tidbits I need to be able to connect to, such as 'Where used", what equipment is used to process it, where it's purchased from and any characteristics.

    Chugging along on this and trying to improve things, but my ideas are limited by my own perspective, so happy to hear other thoughts.

    Thank you all for being here!

  7. #7
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    I opened it but have no idea what to do with any of it.

  8. #8
    khayward is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Apr 2017
    Location
    Oregon
    Posts
    89
    I don't think I explained too well. The database is used to manage information about assemblies. Assemblies are comprised of materials and labour, as well as there being other information to manage. The intention is for the user to use the form frmAssemblies to build a materials list (Bill of Materials) as well as a list of associated tasks required to build the assembly (Bill of Operations). These steps are done in subforms (subfrmBOM and subfrmBofO) within the form frmAssemblies and the data is controlled by a master materials list and master operations list (tblBOM and tblOperations), the values are stored in junction tables to allow the same material or operation to be related to many assemblies and vice versa.
    When entering information it is highly likely, especially with the db mostly empty, that the user will need to add material items or operations which are not in those two master lists. The user could simply open frmMaterials and check each item that they want to assign to an assembly but I would like to streamline things a bit. Ultimately, as more information is added, there would be a reduced need to perform that kind of check, but I would prefer to have an option that would negate that need, hence the idea of having the form frmMaterials open as a popout if needed during entering information about an assembly.

    Hopefully that's a better description of the functions than I provided before. Thanks again for being here!

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    You obviously already understand use of NotInList event but for more info, review https://access-programmers.co.uk/for...otinlist+event

    Yes, one form can serve multiple purposes, just needs code to manage it. However, it is not clear what specifically you need at this moment.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  10. #10
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    Hopefully that's a better description of the functions than I provided before.
    Maybe, but it doesn't help me at all. You assume too much, such as expecting us to know which form subfrmBO is just by looking at the form views. I don't want to have to mine your project in design view, trying to figure out which form is which, what form is connected to what query or table, what to open to replicate your problem, etc. etc.

    You have been given 2 or 3 possible approaches, none of which you've commented on.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 01-23-2019, 02:03 PM
  2. Replies: 2
    Last Post: 03-13-2018, 04:26 AM
  3. Replies: 1
    Last Post: 04-28-2015, 07:08 AM
  4. Changing calculation depending on Combobox
    By GraemeG in forum Programming
    Replies: 29
    Last Post: 02-15-2011, 11:33 AM
  5. Replies: 0
    Last Post: 03-16-2006, 04:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums