Freshman
Registered User.
- Local time
- Tomorrow, 01:28
- Joined
- May 21, 2010
- Messages
- 437
Hi all,
I searched for posts on the above topic but could not find an answer specific to my issue.
I use currentdb.execute to insert a value into a listbox and then update the listbox using me.notelist.rowsource = me.notelist.rowsource
I read somewhere that me.notelist.rowsource = me.notelist.rowsource is a sure w tay to requery a listbox instead of me.noteliste.requery.
Anyway - almost all methods I used worked perfectly when I'm in the db (having shift held down when opening the db).
But as soon as I run the db app 'normally (not holding shift down) the listbox does not update consistently.
I added a save button to update and requery and only when I click it a few time (sometimes up to X10) I see my new record in the listbox.
Is there anything I can do to solve the above issue when I open the db 'normally'.
Thanks
FM
I searched for posts on the above topic but could not find an answer specific to my issue.
I use currentdb.execute to insert a value into a listbox and then update the listbox using me.notelist.rowsource = me.notelist.rowsource
Code:
Me.NoteList.Requery
If IsNull(Me.CurNote) = True Then Exit Sub
Me.CurNote = Replace(Me.CurNote, "'", "")
If IsNull(Me.NoteList.Column(2)) = True Then
CurrentDb.Execute "INSERT INTO CommentLog (LoanNumber, LogComment) VALUES('" & Forms!LoggerMaxInvRpt.InvLU & "','" & Me.CurNote & "')"
Else
CurrentDb.Execute "UPDATE CommentLog SET LogComment = '" & Me.CurNote & "' WHERE [ID] = " & Me.NoteList.Column(2)
End If
Forms!LoggerMaxInvRpt!cmdTitleNotes.Caption = "Title Notes (" & DCount("*", "CommentLog", "[LoanNumber] = '" & Forms!LoggerMaxInvRpt!InvLU & "'") & ")"
Me.CurNote = Null
Me.NoteList = Null
Me.NoteList.RowSource = Me.NoteList.RowSource
Me.Recalc
Me.CurNote.SetFocus
I read somewhere that me.notelist.rowsource = me.notelist.rowsource is a sure w tay to requery a listbox instead of me.noteliste.requery.
Anyway - almost all methods I used worked perfectly when I'm in the db (having shift held down when opening the db).
But as soon as I run the db app 'normally (not holding shift down) the listbox does not update consistently.
I added a save button to update and requery and only when I click it a few time (sometimes up to X10) I see my new record in the listbox.
Is there anything I can do to solve the above issue when I open the db 'normally'.
Thanks
FM