Page 3 of 3 FirstFirst 123
Results 31 to 44 of 44
  1. #31
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Thank you
    All I want is


    How Copy the value of a text box to another text box based on the selection of a combo box or a check box (yes / no)

  2. #32
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Thank you
    All I want is
    How Copy the value of a text box to another text box based on the selection of a combo box or a check box (yes / no)

  3. #33
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    I created a Form with 2 textboxes, a checkbox and a button. Behind the button is code to check if the Checkbox has been checked or not.
    The code behind the button click event is
    Code:
    Private Sub BtnCheck_Click()
    If Me.CheckBox = -1 Then
      Me.AnotherTextBox = Me.TextBox1
      MsgBox "moved data to another textbox"
    End If
    Debug.Print MecheckBox; AnotherTextBox, TextBox1
    End Sub
    I have put together 3 jpgs.

    Checkbox_1 shows initial form with some sample data. Note the checkbox is NOT Checked.
    Checkbox_2 shows initial form with some sample data. Note the checkbox is Checked.
    Checkbox_3 shows the form after clicking the Button - data has been moved from textbox1 to anotherTextBox, and the msgbox is displayed.
    Attached Thumbnails Attached Thumbnails Checkbox_1.jpg   Checkbox_2.jpg   Checkbox_3.jpg  

  4. #34
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Thank you very much for your help
    Click image for larger version. 

Name:	ssssss.JPG 
Views:	18 
Size:	98.5 KB 
ID:	15478Click image for larger version. 

Name:	ssssa.JPG 
Views:	18 
Size:	26.0 KB 
ID:	15479

  5. #35
    MarvinM's Avatar
    MarvinM is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Dec 2013
    Posts
    30
    Put a single quote ( ' ) in front of "If Me.PaymentMade = Later false" like this:
    Code:
    'If Me.PaymentMade = Later false

  6. #36
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by MarvinM View Post
    Put a single quote ( ' ) in front of "If Me.PaymentMade = Later false"
    What will that do?

  7. #37
    Xipooo's Avatar
    Xipooo is offline Sr. Database Developer
    Windows 8 Access 2013
    Join Date
    Jan 2014
    Location
    Arizona
    Posts
    332
    Quote Originally Posted by ItsMe View Post
    What will that do?
    He's right. He needs to comment out that line.

  8. #38
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,900
    Or delete the line.

    Or

    ElseIf Me.PaymentMade = Later Then

    But the same thing happens for both conditions, except for the message box.
    Last edited by June7; 02-20-2014 at 04:45 PM.
    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. #39
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Interresting

  10. #40
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    ??? I'm guessing again, but I think PaymentMade is a textbox and would need

    If Me.PaymentMade = "Cash" Then
    me.text45 = Me.Amount
    me.text46 = Me.HAS
    ElseIf Me.PaymentMade = "Later" Then ?????????????? It makes no sense from here!!!!!

    The MsgBox line and the Debug.Print line were copied from my sample code in my post #33,
    and it appears they were "plunked in to the OPs quasi vba" without any regard or understanding
    of what they do or mean.

    I think we have all tried to help the OP, but nobody understands the issue, and nobody has been able to communicate that with the OP. I think we wait again for a better description of the issue/opportunity from the OP.

  11. #41
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Hello guys
    Thank you very much to all of you
    This has helped
    The problem was resolved thanks to the (orange)
    Thanks again work very well

    Private Sub PaymentMade_Click()

    If Me.PaymentMade = "Cash" Then
    Me.Text22 = Me.Text29
    Me.Text24 = Me.Text31
    'MsgBox ""
    ElseIf Me.PaymentMade = "Later" Then
    Me.Text22 = 0
    Me.Text24 = 0
    'MsgBox ""
    End If
    'Debug.Print MecheckBox; AnotherTextBox, TextBox1
    End Sub

  12. #42
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Thank you teachers June7
    I've helped your answer in (#38)

  13. #43
    MarvinM's Avatar
    MarvinM is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Dec 2013
    Posts
    30

    Thumbs up

    Azhar,

    Thank you for posting the working code. This will help others in the future.
    A helpful tip is to use the "#" button in the formatting bar to highlight your code like this:
    Code:
    Private Sub PaymentMade_Click()
    
    If Me.PaymentMade = "Cash" Then
      Me.Text22 = Me.Text29
      Me.Text24 = Me.Text31
      'MsgBox ""
    ElseIf Me.PaymentMade = "Later" Then
      Me.Text22 = 0
      Me.Text24 = 0
      'MsgBox ""
    End If
      
    'Debug.Print MecheckBox; AnotherTextBox, TextBox1
    
    End Sub
    _________________
    Regards,
    Marvin M
    Windows 7 Professional, MS Access 2007/2010
    Windows 8 Professional, MS Access 2013
    -------------------------------------------------------------------------------------------------------------------
    If this post has helped you, please click on the little sheriff badge in the lower left corner. Thanks!
    -------------------------------------------------------------------------------------------------------------------

  14. #44
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Thank you MarvinM

Page 3 of 3 FirstFirst 123
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Billing first 2 hrs at one rate
    By wnicole in forum Queries
    Replies: 9
    Last Post: 12-12-2013, 07:18 PM
  2. Billing DB form
    By Symlink in forum Access
    Replies: 47
    Last Post: 07-30-2013, 08:37 PM
  3. time and billing DB
    By gpnhmiller in forum Access
    Replies: 4
    Last Post: 12-31-2012, 04:27 PM
  4. Multiple Payment Instances
    By luckysarea in forum Queries
    Replies: 3
    Last Post: 04-21-2011, 03:29 PM
  5. Client Payment History
    By GMatos78 in forum Access
    Replies: 4
    Last Post: 04-24-2010, 09:19 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