Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2006

    Unanswered: Listbox Binding Issue

    I have encountered this problem when displaying the selected records from my populated listbox in the textbox using MS Acess and visual basic. I am very alienated in this environment. For instance, when i select database, it should be displayed in the textbox. I have bounded the field subjectCode to the controlSource.

    May I know whether do I have to set any focus for the textbox or listbox? If yes, how should it be set or bind the listbox to the textbox?

    It would be very much appreciated if anyone could provide some code reference or guidance.

    Error message:
    Update or CancelUpdate without AddNew or Edit.

    AfterUpdate event for Listbox0

    Dim rs as RecordSet
    rs = Me.RecordSetClone
    rs.FindFirst[StudentId] & (Str(Nz!Me(List0,0)
    If not EOF then Me.Bookmark = rs.Bookmark

    What does RecordSetCLone does?
    What does AddNew or Edit works?
    What does Bookmark does?
    What does FindFirst does?
    WHat does Nz does?
    What is !?

  2. #2
    Join Date
    Nov 2004
    I think there's a possibility that the problem stems from you trying to use this listbox for both navigation and binding to a field in the recordsource, which, as far as I know, one cannot do. If you wish to use it for navigation, you must remove the controlsource of the listbox. See if that helps.

    Also, when asking questions, please post the code you are actually using. The code you posted, does not work, and should provide entirely different errormessages (the compile error; Invalid use of property). This makes it hard to guess what is the actual problem.

    To find out more about the objects you ask about, place the cursor within the object when you're in the VBE, then hit F1.

    One issue which you probably will not find there, is the declaration. It's advisable to be explicit with the declaration;

    Dim rs as DAO.Recordset

    in stead of

    Dim rs as Recordset

    For more help, post the actual code, and the relevant properties of the listbox, from the top of my head, ControlSource, RowSource, RowSourceType, Bound Column, Column Count

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts