Link to home
Start Free TrialLog in
Avatar of Megin
Megin

asked on

Refresh only 1 field on an Access form

I have run into a strange problem with the form I am working with.

The form does the following:

The user chooses an item from a combo box. Then a list of the items assigned to the first combo box item appears in a list box. At the bottom of the form is a place to add new items to the combo box item.

Every time I choose an item in the combo box, an additional blank record is being added to the combo box item. So, in the list box there are blank records.

I am thinking this is because I have the "Refresh Record" attached to the "After Update" event for the combo box. I wanted the list box to update every time an different choice in combo box is made.

It looks like it might be adding the values from the bottom of the form, which are empty when I first choose the item in the combo box, when the refresh record action is taken.

I am not sure what to do about this. I don't see a way to only refresh one field on a form. I am assuming there must be a way, but all I am finding are ways to refresh the whole form.
I have also tried putting the refresh option on the list box in the "Before Update" event. Nothing happened.




Any ideas?
Avatar of Megin
Megin

ASKER

Okay, I have a copy of my database I am attaching. The form is frm_SubTaskOrders.
NewStartPMAC.accdb
Avatar of Scott McDaniel (EE MVE )
I don't understand the issue. If I open your database and open frm_SubTaskOrders, I can select a value from the combo and the related records appear in the "Existing Subtask Orders" listing. I don't see where new records are added, or anything of that nature.

So could you please restate the question?

Also, please Compact your database before uploading it here.
ASKER CERTIFIED SOLUTION
Avatar of JimFive
JimFive
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@Megin
"Refresh Record" is used by Access to look and see if another user/process has changed the record you are presently using.  Generally, using DAO technologies--which you are--RefreshRecord is a useless call.  If another user has edited the record, you generally won't be able to successfully save your own edits anyway -- or no one has changed the records and so the call was useless.  Very rarely will you ever need to refresh records.

Requery is frequently used.  That command tells a control to go back to its data source and reload its data.  When you have cascading controls--which you do--in the AfterUpdate event of the 'parent' control, you tell the child control to requery, so that the change to the parameter gets reflected.
Avatar of Megin

ASKER

Thank you! That was just the solution I needed. It worked great!