Minggu, 16 April 2017

[MS_AccessPros] Default Values for text box

 

I have a form with several text boxes and a combo box.  The last control is a text box (txtEquipmentSort) to enter a sort number for report ordering purposes later in the application.  The sort number must begin with a letter and then is followed by 3 digits.  The next to last control is a combo box with a field named Application Group.  Based on the selection made in cboApplicationGroup, I want to set the default value for txtEquipmentSort control.  this is the code I have in the cboApplicationGroup AfterUpdate Event:

Private Sub cboApplicationGroup_AfterUpdate()
    Select Case cboApplicationGroup.Value
        Case 1 'Boiler
            txtEquipSort.DefaultValue = "B000"
            MsgBox "Boiler"
        Case 3 'Cooling
            txtEquipSort.DefaultValue = "C000"
            MsgBox "Cooling"
        Case 5 ' Process Equipment
            txtEquipSort.DefaultValue = "P000"
        Case 10 'Other
            txtEquipSort.DefaultValue = "A000"
        Case 12 'Wastewater
            txtEquipSort.DefaultValue = "W000"
        Case 13 'External Equipment
            txtEquipSort.DefaultValue = "X000"
        Case Else
            txtEquipSort.DefaultValue = ""
            Me.cboApplicationGroup.SetFocus
    End Select
End Sub

I put the two MsgBox statements in just to see if the Case was working.  I get the correct MsgBox statement but no default value is getting loaded into txtEquipSort.


__._,_.___

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

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