Results 1 to 8 of 8
  1. #1
    DerekAwesome is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    15

    Use Toggle button to select subform value

    I need to have a toggle button on the left of a subform that can select a value in the subform so I can use put it into a textbox in the parent form or something like that. Max values in subform right now is only 2.




    Any suggestions?

    EDIT there is only one field in the subform, if that makes it easier

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,913
    Not really. Why would a value need to be taken from subform and placed on main form? What are you really trying to accomplish?
    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
    DerekAwesome is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    15
    hahahhaha I'm trying to accomplish getting the points because this is all credit no credit, my professor is a dumbass, and it's due in 45 minutes.

    he explicitly stated there needs to be toggle buttons to the left of the subform (which I never thought was possible or applicable) that need to be used to select an account to make a deposit into. Subform has accounts of students selected in a list box above


    sorry for being a little agressive. Just stressed

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,913
    45 minutes!? So many unknowns, doubt will meet the deadline. Nothing like waiting till the last minute.

    I agree, a toggle button doesn't make sense.

    The main form is bound to students and subform is bound to accounts (these are students accounts and students have multiple accounts?)? Never seen a toggle button used like this. Is this a toggle button next to each record in the subform that is bound to a Yes/No field of accounts table or is this a toggle button that actually sits on the main form? If the button is on main form and subform is in datasheet view, have to first select record in subform then trigger event that would save the account number to textbox on main form. It might even be code is not needed. The main form textbox ControlSource could have an expression that references field of subform.

    If you want to provide db for analysis, follow instructions at bottom of my post. Be aware if it is an Access 2010 file with Access 2010 exclusive features, might not be able to open it until late tonight.

    What do you mean by 'max values in subform right now is only 2'?
    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
    DerekAwesome is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    15
    Maximum accounts that any of the students have is 2. But don't worry about it now. It was actually the final for this class, but we are allowed to use the internet because I thought I'd try. Most people get zeros on the final anyway

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,913
    Oh, you are in class and just given the problem as an exam! If single toggle button on main form then code in Click event could be like:
    Code:
    Private Sub ToggleName_Click()
    If Me.ToggleName = True Then
        Me.TextboxName = Me.SubFormName!FieldName
    Else
        Me.TextboxName = Null
    End If
    End Sub
    Again, must select record in subform before clicking toggle.

    Good luck!
    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.

  7. #7
    DerekAwesome is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    15
    Sorry for the late response, I didn't get to implement it for the points that time but its exactly what I needed and I'll remember it for next time. Thanks!

    now if I knew how to mark as solved I would

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,913
    See the Thread Tools dropdown at top of first 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.

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

Similar Threads

  1. Toggle Button Help
    By dbalilti in forum Access
    Replies: 1
    Last Post: 07-05-2012, 04:23 AM
  2. Toggle Button Criteria
    By tylerg11 in forum Forms
    Replies: 2
    Last Post: 03-02-2012, 09:28 AM
  3. How to create a datasheet toggle button
    By tobydobo in forum Access
    Replies: 7
    Last Post: 02-06-2012, 01:12 PM
  4. Toggle Button on Bound Form
    By P5C768 in forum Forms
    Replies: 7
    Last Post: 12-30-2010, 03:00 PM
  5. Toggle Button Options
    By Matthieu in forum Forms
    Replies: 2
    Last Post: 11-23-2009, 04:05 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