Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-22-2017, 08:54 AM
N323100 N323100 is offline Checkbox and Textbox Question Windows 10 Checkbox and Textbox Question Office 2010 64bit
Novice
Checkbox and Textbox Question
 
Join Date: Mar 2017
Posts: 5
N323100 is on a distinguished road
Default Checkbox and Textbox Question

I have a project and I would like to put some enhancement with this. I have a Checkbox "Other" then if the user click or chose that Checkbox the user is required to put some additional comment to the separate textbox. I would like to ask on how to code that if I click the submit button it will transfer the information to database on a blank rowI had already a existing code, I just would like to add the Textbox "Additional Comment". Please see attached file. Quality Tool.xlsm

Thank you
Reply With Quote
  #2  
Old 03-22-2017, 02:23 PM
NoSparks NoSparks is offline Checkbox and Textbox Question Windows 7 64bit Checkbox and Textbox Question Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

Your profile indicates having Office 2010 64bit.... are you sure.
I do, and the file you've attached won't run on 64bit Excel.

Seeing this question is also posted on MrE and is 5 pages deep at EF
you should take a moment and read this http://www.excelguru.ca/content.php?184
Reply With Quote
  #3  
Old 03-23-2017, 10:37 AM
NoSparks NoSparks is offline Checkbox and Textbox Question Windows 7 64bit Checkbox and Textbox Question Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

You are currently looping through all controls looking for check boxes, if the check box is True, you are copying its Captain to column 7.
You'll need to look at that captain to decide if you want to copy the caption to column 7 or the text from the associated text box to column 8, or maybe do both.
Perhaps something along the lines of
Code:
    ' Attributes Target
    For Each ctrl In Me.Controls
        Select Case TypeName(ctrl)
        Case Is = "CheckBox"
            If Me.Controls(ctrl.Name).Value = True Then
                'if it is not an 'Other' chkbox
                If Me.Controls(ctrl.Name).Caption <> "Other" Then
                    .Offset(RowCounter, 7).Value = vbCrLf & Me.Controls(ctrl.Name).Caption
                    RowCounter = RowCounter + 1
                Else
                    'get number from chkbox name    'dim num at beginning of sub as string
                    num = Mid(ctrl.Name, 9)
                    .Offset(RowCounter, 7).Value = vbCrLf & Me.Controls(ctrl.Name).Caption
                    .Offset(RowCounter, 8).Value = Me.Controls("Textbox" & num).Value
                    RowCounter = RowCounter + 1
                End If
            End If
        End Select
    Next ctrl
Reply With Quote
  #4  
Old 03-23-2017, 09:56 PM
N323100 N323100 is offline Checkbox and Textbox Question Windows 7 64bit Checkbox and Textbox Question Office 2010 32bit
Novice
Checkbox and Textbox Question
 
Join Date: Mar 2017
Posts: 5
N323100 is on a distinguished road
Default

For Checkbox "Other" and Textbox "Additional Comment" it should be both copied to a cell. I'll try this one. Thank you and Have a great day!
Reply With Quote
  #5  
Old 03-23-2017, 10:18 PM
N323100 N323100 is offline Checkbox and Textbox Question Windows 7 64bit Checkbox and Textbox Question Office 2010 32bit
Novice
Checkbox and Textbox Question
 
Join Date: Mar 2017
Posts: 5
N323100 is on a distinguished road
Default

Wow! Thanks its Working!!
Reply With Quote
  #6  
Old 03-29-2017, 12:08 AM
N323100 N323100 is offline Checkbox and Textbox Question Windows 7 64bit Checkbox and Textbox Question Office 2010 32bit
Novice
Checkbox and Textbox Question
 
Join Date: Mar 2017
Posts: 5
N323100 is on a distinguished road
Default

I have a follow up question with regards to Start and Time, What if the user was not completely done with his activity and he wants to tag his work as pending due to some circumstance (Brea, Lunch, Team Meeting and Coaching) I cant visualize on how to create start pause and time sequence. Thank you!
Reply With Quote
Reply

Tags
#macros



Similar Threads
Thread Thread Starter Forum Replies Last Post
Checkbox and Textbox Question Macro Needed to Insert Asnwer to A Question in Multiple Choice Format Question rsrasc Word VBA 7 03-28-2014 12:28 PM
Checkbox and Textbox Question Checkbox in Userform lukael Excel Programming 5 02-18-2014 05:20 AM
Checkbox and Textbox Question Display result in textbox based on the input of another textbox scarymovie Word VBA 5 05-16-2012 07:05 PM
macro on checkbox macrohelp Word VBA 0 03-06-2009 03:33 PM
resizing a checkbox?? aceensor Excel 0 05-10-2006 01:44 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:59 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft