Avatar of swindsorct
swindsorctFlag for United States of America

asked on 

Can't refresh combox box and/or query

I am having difficult getting a combobox field to refresh/requery…

I have a table of  customers, with an autonumber key.   I have a second table of contacts for those customers (also with autonumber key).  Because the contacts may be attached to multiple customers  I have created a link table where the customer autonumber and the contact auto numbers are stored.    When I display the customer,  a subform of this linked table filters on the customer number, and displays a list of matching links.   To display the contacts in a human friendly manner I have a combo box based on a query of the contact table.

This is so that in the event one contact is used of multiple customers there is only on contact to maintain.  So far all this works well.  If the user double clicks a contact in the combo box  that contact opens for display and editing.

When the user double clicks the blank bottom (add a record row)  contact,  the form opens with a blank record to be added.    Records add just fine.  But when I go back to the combo form,  the new record is on there….in the combo box.   I have found that the record has been added to the contact table, and the link table.    It seems the query has not refreshed/requeried, and/or the form/ combo box has not refreshed/requeried.

It has been a log time since I have done this programming,  I get the feeling I am looking straight at the problem…..and not seeing it.   (can’t see the forest cause all those trees are in the way).

i'm using ms access 2003
Microsoft Access

Avatar of undefined
Last Comment
swindsorct
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

after adding the record, you need to requery the combo box

Forms!nameOfForm!comboName.requery
Avatar of swindsorct
swindsorct
Flag of United States of America image

ASKER

Tried that.  Perhaps I adding it to the wrong place.  In the contactsadd form  it gives me the error It cant find the control.
what is the name of the form where the combo box is?
what is the name of the combo box?
Avatar of swindsorct
swindsorct
Flag of United States of America image

ASKER

the combo box name contact  is on a form name links.

links is a sub form on the for clients

i"ve tried    forms!links!contacts.requery   and forms!clients!contact.requery

on form!links   i put it in on update   and on add         on forms!clients   on update

the add a record form that is opened  form!contacts   on add, on update and on close
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of swindsorct
swindsorct
Flag of United States of America image

ASKER

Thast hit the nail right on the head.    Thank you!!!!!
Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo