W
Wylie C
I have the following code in a form. Prior to this code being executed the
user is modifying a record (not adding a new record). I don't understand why
the <>"" statement for the inputbox doesn't execute the ELSE statement. Help
on form processing logic and/or coding that should be applied will be
appreciated. The Call CloseForm statement only contains the code: DoCmd.Close
, "frmSongList", acSaveYes
Private Function RestartAllInputs()
Dim strEnterAnother2 As String, intInvalid As Integer
intInvalid = 4
If intAnother = 0 Then
'strEnterAnother2 = InputBox("Enter New Title", "Add New Album
Information")
'On Error GoTo HandleThis
strNewAlbumName = InputBox("Enter Album Name", "Album Title")
If strNewAlbumName <> "" Then
strKeepAlbumName = strNewAlbumName
intNewTrackNum = 0
DoCmd.GoToRecord , , acNewRec
Me!TrackNum = intNewTrackNum
Me!Album = strKeepAlbumName
Me!Title.SetFocus
intEnterAnother = 6
Call ContinueAddingSong
Else
'DoCmd.GoToRecord , , acLast
Call Closeform
End If
End If
End Function
user is modifying a record (not adding a new record). I don't understand why
the <>"" statement for the inputbox doesn't execute the ELSE statement. Help
on form processing logic and/or coding that should be applied will be
appreciated. The Call CloseForm statement only contains the code: DoCmd.Close
, "frmSongList", acSaveYes
Private Function RestartAllInputs()
Dim strEnterAnother2 As String, intInvalid As Integer
intInvalid = 4
If intAnother = 0 Then
'strEnterAnother2 = InputBox("Enter New Title", "Add New Album
Information")
'On Error GoTo HandleThis
strNewAlbumName = InputBox("Enter Album Name", "Album Title")
If strNewAlbumName <> "" Then
strKeepAlbumName = strNewAlbumName
intNewTrackNum = 0
DoCmd.GoToRecord , , acNewRec
Me!TrackNum = intNewTrackNum
Me!Album = strKeepAlbumName
Me!Title.SetFocus
intEnterAnother = 6
Call ContinueAddingSong
Else
'DoCmd.GoToRecord , , acLast
Call Closeform
End If
End If
End Function