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)
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)
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)
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
I have put together 3 jpgs.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
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.
Put a single quote ( ' ) in front of "If Me.PaymentMade = Later false" like this:
Code:'If Me.PaymentMade = Later false
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.
Interresting
??? 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.
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
Thank you teachers June7
I've helped your answer in (#38)
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!
-------------------------------------------------------------------------------------------------------------------
Thank you MarvinM