Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Another subform question (Access 2K, Win 2KPro, SQL Server 2K)

    OK, I have the subform acting as desired. Thanks, Hans!

    another question -- is it possible to toggle a subform from Datasheet to Single Form view using a button on the main form?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Another subform question (Access 2K, Win 2KPro, SQL Server 2K)

    No, you can only specify this in design view.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Another subform question (Access 2K, Win 2KPro, SQL Server 2K)

    actually, for once in all my years on the lounge I think -- you're wrong! <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15>
    you can put a button on the subform and use the code

    RunCommand acCmdSubformDatasheet

    now I'm trying to see if I can toggle it back from the main form. if the subform is selected, go to View|Subform Datasheet and uncheck it.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Another subform question (Access 2K, Win 2KPro, SQL Server 2K)

    You're correct - almost <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15>

    Try this:

    Private Sub tglSwitch_Click()
    Me.SubFormName.SetFocus
    If Me.tglSwitch Then
    RunCommand acCmdSubformDatasheetView
    Else
    RunCommand acCmdSubformFormView
    End If
    End Sub

    where tglSwitch is the name of the toggle button and SubFormName is the name of the subform as a control on the main form (this is not necessarily the same as the name of the subform in the database window)

  5. #5
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Another subform question (Access 2K, Win 2KPro, SQL Server 2K)

    that's basically what I ended up with, but used a View Datasheet button on the subform and a View Form button on the main form, using the RunCommand acCmdSubformDatasheetView code. now I need to set the form/subform to load with the most recent record in the subform...but, progress is being made!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •