473,808 Members | 2,885 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Requery Combobox after Updating List in Another Form

6 New Member
I am using Microsoft Access 2007. I have a list in a dropdown combobox (Field_One) in a form (Form_One). Users have the option to click a button if the item they need does not appear in the combobox, and another form, (Form_Two) opens to which they can add the new item (in Field_Two). After adding the new item in F_Two I want the combobox in F_One to requery without having to close and reopen F_One. I think I can do this with an After_Update event, but to which object should the event apply? Or is there a better way to do it?

Thank you
Jul 28 '10 #1
4 1739
MikeTheBike
639 Recognized Expert Contributor
@Organizer
Hi

Maybe something like this in Form_Two
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_AfterUpdate()
  2.     If CurrentProject.AllForms("Form_One").IsLoaded Then Form_Form_One.ComboBoxName.Requery
  3. End Sub
??

MTB
Jul 29 '10 #2
missinglinq
3,532 Recognized Expert Specialist
Users have the option to click a button if the item they need does not appear in the combobox, and another form, (Form_Two) opens to which they can add the new item (in Field_Two).
In the code behind your button, why not simply
  • Open Form_Two with the Window Mode argument set to Dialog
  • Follow the form opening line of code with Me.ComboName.Re query
Welcome to Bytes!

Linq ;0)>
Jul 29 '10 #3
Organizer
6 New Member
Thanks for he suggestions. Problem not solved yet.

MTB: I replaced the code I had with your new suggestion, but got the same result. Updates from Form_Two show, but new additions don't until I close and reopen Form_One.

Linq: I looked at the code behind that button. I'm afraid that your suggestion is a little beyond me, since the Window Mode argument isn't already there - I don't know how to write it. But, reading the suggestion, how would having the requery happen in conjunction with clicking that button help, since that button opens the form where the new item will be added, so at the time of clicking the new item doesn't exist so there is not yet anything new for the requery to find?

Is it a problem that this combobox was created at the table level, rather than at the form level (so it was automatically a combobox when I added the field to the form)? Or does that not matter?

Thanks again. Hope we can crack this.
Jul 29 '10 #4
MikeTheBike
639 Recognized Expert Contributor
@Organizer
Hi
Is it a problem that this combobox was created at the table level, rather than at the form level (so it was automatically a combobox when I added the field to the form)? Or does that not matter?
That shouldn't matter at all.

So, in Form_Two you are adding an additional record into the table that the combobox on Form_One is based. Is that correct?

If so how is the insert accomplished?

Is it a form bound to the table?

Have you check that the code in the Form_AfterUdate event is running correctly or at all?
For instance, you could put this line in the event

msgbox CurrentProject. AllForms("Form_ One").IsLoaded

This should display True if correct, or False if not added correctly (ie the form name is wrong or its not loaded, or not be displayed at all if not firing!!

MTB



MTB
Jul 30 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2437
by: David | last post by:
Hi, I have a form which requires Serial Numbers to be loaded from another form. When I press a button, another form opens with a list of Serial Numbers. I have the record selectors enabled. I want to select a serial number range with the record selectors then press a button called 'LOAD'. The selected Serial Numbers should then
2
10901
by: F. Michael Miller | last post by:
I need to requery a subform from a third form and can't seem to get it to work. frmForm1 has frmAddress as a subform. The button cmdReviseAddress opens the form frmUpdateAddress where all of my validation work is done and the new record is added. However, the new address is not being displayed in the subform. If I use the command
11
38233
blyxx86
by: blyxx86 | last post by:
I can't seem to get this figured out. I am trying to requery another form after adding new information to a table that a cboList is created from. So, I have a combo box that has Sales personnel, and i have another form that lets me add sales personnel to the table of all the sales team. (Name, number, etc...) But when I open up the main form (with the combo box of Sales Personnel) and then open the form to add new members, or edit the...
5
8116
by: ApexData | last post by:
I have a ComboBox, when dblClicked, displays the combobox's row content in a continuous subform. Changes can be made to this content in the subform and then closed. The ComboBox needs to be requeried to immediately reflect these changes. The problem is that I can't requery in the OnDblClick event of the ComboBox because the event completes once the subform is launched. I guess I could requery the combobox from the Close event of the...
2
8459
by: hlebforprimeminister | last post by:
Hi I am having a problem with the visualbasic for requerys in access. I have had a look at some of the other discussions but i can't find an answer. So, my problem is this. I have a form with several different combo boxes, from which the user will select an option. If what they require is not there, they double click on the combo box and it brings up another form in which the put in data. Once they click a button it closes the new form...
0
1136
by: adalyc | last post by:
I NEED SOME GUIDENCE WITH UPDATING A COLLECTION OF ITEMS IN A LIST BOX WHEN THE USER CLICKS ON A BUTTON FROM ANOTHER FORM,, i HAVE LISTED THE PROBLEM PARTIALLY. I fIGURED OUT MOST OF THE PROBLEM EXCEPT FOR THE UNDERLINED PART. pLEASE HELP. thIS IS VISUAL BASIC 2005 An airplane has 15 rows (numbered 1 through 15), with six seats (labeled A, B, C, D, E, and F) in each row. . When the agent clicks on one of the text boxes, a second form...
2
5884
by: SePp | last post by:
Hi all. I want to refresh a Datagrid from another form. For Example I have a Datagrid in that I want to edit data. The user has the ability to press a button to change these data. A new Form opens and the user changes the data. After that he saves the changes and the current form is closing and the old form with the datagrid gets the focus again.
1
2509
by: viranadim | last post by:
I am having problems with attempting to filter a form based on criteria selected in a combo box from another form. I am attempting to filter a form called "Ford CheckList" that is based on a table called "Ford Returned Warranty Parts List". I am using the catagory "Program" that is in a combobox called "Program_Combo" which is located on a form called "Ford Database: Choose an Option". I want the user to open the form "Ford Database: Choose an...
1
1958
by: viranadim | last post by:
I am having problems with attempting to filter a form based on criteria selected in a combo box from another form. I am attempting to filter a form called "Ford CheckList" that is based on a table called "Ford Returned Warranty Parts List". I am using the catagory "Program" that is in a combobox called "Program_Combo" which is located on a form called "Ford Database: Choose an Option". I want the user to open the form "Ford Database: Choose an...
1
1689
by: menyki | last post by:
am still finding it difficult as a new java user. am designing a software that has multiple forms, controls such as combobox and so on and finding it difficult to do the following. i want some combobox in the software to fill at design time, i.e. two combobox the first one already has 2 items, i want a situation whereby an item selected from the first combobox determines what items will fill the second combobox. secondly, i want to...
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10631
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10374
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10114
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9196
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7651
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6880
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5548
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3011
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.