Sabtu, 31 Desember 2016

[MS_AccessPros] Default Value

 

I am trying to set a default value into a "bottles required" text box control based on the value of the fourth column of a combo box.  I was able to do that successfully.  However, there is another text control txtSpecialTests that will affect the number of bottles required.  Basically, if there any special tests in the txtSpecialTests control, I want to add 1 to the value in column 4 of the combo box.  If txtSpecial tests is empty or null, I don't want to add 1.

I have the following code in the AfterUpdate event of the combo box:
Private Sub cboSelectedGridID_AfterUpdate()
    Select Case Me.txtSpecialTests
        Case IsNull(Me.txtSpecialTests)
            Me.txtBottlesRequired = Me.cboSelectedGridID.Column(3)
        Case Me.txtSpecialTests = ""
            Me.txtBottlesRequired = Me.cboSelectedGridID.Column(3)
        Case Else
            Me.txtBottlesRequired = Me.cboSelectedGridID.Column(3) + 1
    End Select
       
End Sub

It adds 1 every time, no matter whether the txtSpecialTests control is empty, null or not.


__._,_.___

Posted by: david.pratt@outlook.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (10)

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