Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168

    Make Each form a "Form with a Tab" to be Clickable from Main Form ?

    Ok .. well I would like to redesign my database.



    I presently have a main switchboard form that launches one of 20 individual forms.

    Well .. I want to change that to one main switchboard form .. with the ability of the individual forms being on tabs .. so I can just click on them from one Main form.

    Right now .. I just click on a button on the switchboard and the form pops up (they are pop up forms) .. and the switchboard is made non visible, which is then made visible again when the appropriate form closes.

    So can I convert all these forms .. to forms with tabs ? I know about the tab control .. but really I need each tab to be an actual form which acts like to totally separate form. Many of my actual forms are continuous forms.

    If Access .. cannot do this, this would be a very nice feature for the future. Just thinking.

    Thanks
    - Kevin -

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Put subform container control on page of tab control. I do this a LOT.
    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.

  3. #3
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168
    Ok .. so if I understand correctly .. make a main form. Add tabs as needed .. in my case like 20 tabs. Then add a subform to each tab .. and put the contents of my form on that subform ?

    I am hoping that I will not have to totally change everything .. but I will do it if it is not totally insane and I have to recode everything.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Twenty is a lot of tabs. Most I've ever done is 8.

    Add subform container control and set the ControlSource property.

    Make sure the tab is selected before dragging subform container control from design ribbon, otherwise it will end up on the main form.
    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.

  5. #5
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168
    Actually I have tried it .. and added a couple of old forms. Not too bad ... but the test will be one of the continuous forms. But so far .. looks promising.

    I am using a copy of my database of course .. so it will work for now.

    Thanks June7 for your tip .. but I managed a couple of forms and it is working well.

  6. #6
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168
    Abandoned this idea .. it is good in theory but honestly having each form as a separate form is so much easier. It is just not worth the effort to change now after my database is already built.

  7. #7
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168
    But now ... frmMainSwitchboard is the main form with all the tabs on it .. and the frmCallsign form is now a subform of that form. (named subCallsign).

    Ok .. this is what I have .. [Forms]![frmMainSwitchboard]![subCallsign]![txtFilter]

    Do you have any recommendations as far as naming conventions .. like I imagine I should name my subform as like sbfForm .. or subForm. I prefer sub as it is easier to remember.

    Because everything is on a subform which is part of a new form .. everything in my database will have to be changed.

    Looking for tips .. ? it would have been nice if I would have thought about this way of doing things from the get go.

    Well .. my first gotcha, DLookup or ELookup doesn't seem to accept ... [Forms]![frmMainSwitchboard]![subCallsign]![txtFilter] but I can use it in a query but not the after update of a text box.

    If I cannot do things cause things are on a subform .. I am not going to do this.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    The queries have dynamic parameters that reference form controls? I don't use dynamic parameterized queries.

    References to subform elements must go through the container control. I always name the control different from the object it holds.
    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.

  9. #9
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168
    So .. the first one will work .. second one will not. They are both valid controls on a form.

    varResult = ELookup("[Callsign]", "qryCallsignDescription", "[CallsignLetter] ='" & Forms!frmCallsign!txtFilter & "'")

    varResult = ELookup("[Callsign]", "qryCallsignDescription", "[CallsignLetter] ='" & Forms!frmMainSwitchboard!subCallsign!txtFilter & "'")

    Looking for suggestions .. there is no parameter to the field in the query itself.

    This is the SQL from the query above .. SELECT DISTINCT Callsign.CallsignLetter, CallsignAlpha.Callsign FROM CallsignAlpha INNER JOIN Callsign ON CallsignAlpha.Letter = Callsign.CallsignLetter;

    The interesting thing .. is that if I run the form itself (which is the source of the subform) .. it works just fine, even though it is like the 2nd example. But running it from the tab subform it does not work.

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Depends where that code is placed. Did you test the second?

    Are you back to considering redesign?

    Are postings are crossing in midair.

    Reference with subform container name should work.
    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.

  11. #11
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168
    Code is in after update ..

    I am open to anything right now. I have tons of time and will just work one form at a time (the production database is still 100% working. I am using a copy for doing this) .. so this is what I want. Enter in a value .. ie "C" in a text box .. and get a description for that entered letter, ie "C Division". Data is in same table.

    I am using ELookup .. DLookup clone. But it does not work.

    Looking for suggestions .. on how to do it ?

    Here is my code ...

    If Not IsNull(Me!txtFilter) And IsNumeric(Me!txtFilter) = False And Len(Me!txtFilter) < 2 Then

    Me.RecordSource = "qryCallsignLookup"

    strResult = DLookup("[Callsign]", "qryCallsignDescription", "[CallsignLetter] ='" & Forms!frmMainSwitchboard!subCallsign!txtFilter & "'")

    If Not IsNull(strResult) Then

    Me!lblFilter.Caption = strResult
    Me!txtFilter = Null
    Me!txtFilter.SetFocus

    Else

    Me!lblFilter.Caption = " No Results Returned .. "

    End If


    End If

    Me!txtFilter = Null
    Me!txtFilter.SetFocus

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    In AfterUpdate of textbox? Where is the textbox?

    Why a textbox instead of combobox? The description could be a column of combobox and would then be available to the form and no code required.

    If you want to provide db for review, follow instructions at bottom of my post.
    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.

  13. #13
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168
    Found the problem .. and it is just a beginner mistake. I was not referring to the control properly .... as I am used to having one form and a control on that form.

    What I thought I was referring to .. was not what it really was, and that was the issue here.

    Now .. with tabs and subforms .. it is just different than just a form .. more layers and I have to nail down my naming conventions I will use and how to refer to things.

    Nothing is broken really ..

    But I think that it should be possible to directly just make a form with a tab on it so that you can just go from a switchboard type design to a tabbed design for your forms. That way you do not have to alter anything. Maybe for the next version of Access. *LOL*

    It would be nice
    Last edited by edmscan; 07-29-2014 at 07:30 PM.

  14. #14
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168
    If someone could help me with the syntax of referring to a controls on a subform on a tab on a main form .... and I understand you can use "Parent" ... but I will see what I can find on the web.

    So .. like is it: Forms!frmMainFormContainingTabs!Tab!Subform!Contro l .. just confused. And can I use Me like on a regular form ?

    EDIT ... ok found it. Forms!frmMainForm.subFormName.Form.Control .... but is there any simpler way ? I am mainly interesting in the Parent thing ... and if I can use Me. I imagine Me will still work, but in SQL Me does not work that I can tell and it needs the whole thing. Someone correct me if I am wrong here.

  15. #15
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168
    I am happy to report that things are going very well .. and thanks June7 for your help. You always seem to come to my rescue even if I am being difficult. I was so stressed .. but with my new knowledge I am am doing well. I have to say that in 15 years of using Access .. I have never used a Subform. Never needed to.

    But I do like the tab controls .. better than opening and closing individual forms from a switchboard like I had before.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 8
    Last Post: 11-26-2013, 12:21 PM
  2. Replies: 9
    Last Post: 08-19-2013, 03:00 PM
  3. Replies: 5
    Last Post: 08-03-2012, 04:20 PM
  4. "Clickable" title in report
    By .:SoundWave:. in forum Reports
    Replies: 6
    Last Post: 01-01-2011, 08:19 AM
  5. Replies: 1
    Last Post: 10-21-2010, 12:02 PM

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