gin
01-26-2003, 08:16 PM
Hello all,
I'm making a small rename program for fun. My program is such that parts of the form are only enabled when doing something else. Example below:
Private Sub cboAdd_Click()
If cboAdd.Text = "at position" Then
txtAddPos.Enabled = True
txtAddPos_Change
Else
txtAddPos.Enabled = False
End If
Update '====update
End Sub
Private Sub txtAddPos_Change()
If txtAddPos.Text <> "" Then 'do some stuff
strTemp = txtAddPos.Text
ErrCheck strTemp, errAddPos, errPosInt
If arrError(errAddPos) = 0 Then intAddPos = CInt(strTemp)
Else
intAddPos = 0
End If
Update '====update
End Sub
After any change, a preview of the changed filenames is automatically shown (called by Update). However, if you'll look at the example above, an Update can be called multiple times when doing one change, which is redundant. How can I call just one update without repeating code or using an Update button? I'd really appreciate any ideas.
I'm making a small rename program for fun. My program is such that parts of the form are only enabled when doing something else. Example below:
Private Sub cboAdd_Click()
If cboAdd.Text = "at position" Then
txtAddPos.Enabled = True
txtAddPos_Change
Else
txtAddPos.Enabled = False
End If
Update '====update
End Sub
Private Sub txtAddPos_Change()
If txtAddPos.Text <> "" Then 'do some stuff
strTemp = txtAddPos.Text
ErrCheck strTemp, errAddPos, errPosInt
If arrError(errAddPos) = 0 Then intAddPos = CInt(strTemp)
Else
intAddPos = 0
End If
Update '====update
End Sub
After any change, a preview of the changed filenames is automatically shown (called by Update). However, if you'll look at the example above, an Update can be called multiple times when doing one change, which is redundant. How can I call just one update without repeating code or using an Update button? I'd really appreciate any ideas.