enabling a button when a text box changes

robvr6

Registered User.
Local time
Today, 23:28
Joined
Sep 27, 2005
Messages
23
Hi all,

I was just wondering if it is difficult to enable a cmd button when a text box has been filled in. I have a button that allows users to add a file which displays the filepath in a text box. So what I wanted to do was when the path appears in the text box then this will enable the button. I thought that It may have been something like

Code:
Private Sub FilePath_Change()
cmdOpen.Enabled = True
End Sub

but as usual i was wrong lol

Anyone got any advice on this , thanks
J
 
There is a bit of this in the db2.mdb file I just uploaded for you in your other post. In answer to this posts question; this will do it.

Code:
    If Not IsNull(tbFilePath) Or tbFilePath <> "" Then
        Me.cmdOpen.Enabled = True
        Exit Sub
    End If
but, I fixed your problem in your db1.mdb file with my db2.mdb file by exiting the open file code if the field was null with this code...
Code:
    If IsNull(tbFilePath) Or tbFilePath = "" Then
        MsgBox "Invalid file location.", vbInformation
        Exit Sub
    End If
 

Users who are viewing this thread

Back
Top Bottom