Sabtu, 15 April 2017

Re: [MS_AccessPros] Need help with VBA code

 

Ken-


It would be better to make the default value of Payment Type = Cash, then add code to After Update of Check No.  If a value has been entered in Check No, change Payment Type to Check.  If the user cleared Check No, then set Payment Type back to Cash.

Private Sub Check_No_AfterUpdate()

    If Len(Me.Check_No & "") > 0 Then
        Me.Payment_Type = "Check"
    Else
        Me.Payment_Type = "Cash"
    End If
End Sub

John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals 
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
(Paris, France)




On Apr 15, 2017, at 8:05 PM, kenaf42@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:



Access 2010,

On a form there are 2 text boxes, "Check No" (it is number field) and then" Payment type" (it is text field). I need code for on got focus event of the" Payment type" to be = to Check if there is a value in "Check No" otherwise to be = to Cash


Thank you





__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar