views:

24

answers:

1

I have an Access 2000 database with a custom form. People are entering info into this. On one of the fields I want to automatically append a ".zip" to one of the fields.

How?

A: 

Assuming you have a textBox called txtFileName, then you can use its AfterUpdate event to do this:

Private Sub txtFileName_AfterUpdate()
    If Not IsNull(txtFileName) Then
        txtFileName = Trim$(txtFileName)
        If Not Right$(txtFileName, 4) = ".zip" Then
            txtFileName = txtFileName & ".zip"
        End If
    End If
End Sub
awrigley
Peter
Its working for me... There must be some other factor, external to my code. What happens with you?
awrigley