Results 1 to 9 of 9
  1. #1
    michaelb is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2011
    Posts
    28

    Post Setting the display of a combobox after a record is updated

    Good morning all,
    I used a combobox to select a record in table A. The combobox displays the desired person's name in it and the form shows the correct information. After updating the record, I save it using a macro connected to a button. The macro also creates a new record. The first record in table A is blank so nothing appears in the combobox when the form is opened. How do I get the combobox to show the first record (blank) after the updated record is save and a new record is initiated.

    You may have a completely different way of setting the display in a combobox after a record is saved. If so please let me know.



    Thanks for you help

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,847
    What exactly is the rowsource of the combo?

  3. #3
    michaelb is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2011
    Posts
    28
    The rowsource for the combo is a query using table A. There are two fields in the query, the first is the IDnum and the second is a Fullname field.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,847
    So you are saying that once you save a record in Table A, you no longer have a blank record in the combo. Is that correct? What exactly is available in the combo before and after you save a record?

    You select an entry form the combo and then show details of that record is that correct?

  5. #5
    michaelb is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2011
    Posts
    28
    Before the record is saved in table A, the combobox displays the name use to select the record for updating. After the record is saved and the new record is created, the combobox still shows the last name selected through it. When the record is saved I want the combobox to show a blank:

    Ex. John Doe is selected in the combobox. The information for John Doe is correctly in the form. The desired fields for the record are updated and the record is saved. When the new record is created, the combo still shows John Doe. I want the combobox to show a blank:

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,847
    When the new record is created, the combo still shows John Doe. I want the combobox to show a blank:
    You said the record is updated. So where is the new record coming from?
    John Doe was in combo and selected, fields in the record were updated, the record (same record) was saved.

    New record??

    If your combo row source is from a Table/query, why are you expecting a blank record?

    Perhaps I'm missing something basic.

  7. #7
    michaelb is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2011
    Posts
    28
    The form was originally setup to add new records to a table (A). Later in the process I added a combo to the form to select records to update. There is a Add New Record button and a Save Record button on the form. If the user wants to add a record, they can use the Add button, if they want to update a record they can use the combobox. If they use the combobox and click the Save Record button, the last name selected in the combobox remains when the form is set for a new record. I thought a fix for this would be to save the updated record, set the GoToRecord action to First, which is the blank record. Then I hoped to refresh/repaint??? the combobox which would show a blank. When the new record was then created, the combo would be blank because the last record set was record 1/First. Please suggest another way to handle. I am still learning...

    Thanks

  8. #8
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,847
    I would think that if you have a button labelled, ADD New Record, that you would not be selecting or even looking at the combo.

    In the Click event of the Add New Record button, you would get a fresh empty record.

    I think I'm still missing something with your set up.

    If you add a new record, there is no old record (unless you're adding some other thing related to the person in the combo), so I wouldn't expect the cobo to be part of the Add New record.

  9. #9
    michaelb is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2011
    Posts
    28
    You are right. If a new record is added, there is no old record, but the combobox still displays the old information from the last selected name. The display of old information would be confusing to the users. Is there a way to blank the combobox so the last information is not displayed once the Save Record button on clicked?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Combobox display order
    By Duncan in forum Queries
    Replies: 91
    Last Post: 09-01-2011, 05:12 PM
  2. Setting Record Readonly
    By ganeshvenkatram in forum Access
    Replies: 3
    Last Post: 06-23-2011, 07:36 PM
  3. Replies: 1
    Last Post: 03-24-2011, 07:09 AM
  4. Replies: 9
    Last Post: 12-18-2010, 12:51 PM
  5. tabular forms - setting values per each record
    By Daytona675 in forum Forms
    Replies: 0
    Last Post: 11-25-2008, 09:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums