473,386 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Saving List Box and Combo Box

Hello,
I have a form that I can't figure out. It seems so easy, yet I am blank (long day!). I have a simple form where a name and address is added. I also have a combo box and a list box to select certain criteria (Organization and Department). When I save the information, the selections in the list box and the combo box are not saved when I retrieve the name.
Do you have any suggestions? Here is my code to save the combo boxes.
Expand|Select|Wrap|Line Numbers
  1. Private Sub cboOrgID_AfterUpdate()
  2.     cboOrgID.Requery
  3. End Sub
  4. Private Sub cboDeptID_AfterUpdate()
  5.     cboDeptID.Requery
  6. End Sub
And this is my save button
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdSave_Click()
  2.     If Me.NewRecord Then
  3.         MsgBox "The record has not yet been saved.  You must first save the record.", , "Record Not Yet Saved"
  4.     Else
  5.         If IsNull(cboContAddrID) Then
  6.             gintAddressID = 0
  7.             DoCmd.OpenForm "frmAddr", , , , acFormAdd, acDialog
  8.             cboContAddrID.Requery
  9.             If gintAddressID > 0 Then
  10.                 Me.ContAddrID = gintAddressID
  11.             End If
  12.         Else
  13.             Call SaveRecord
  14.             MsgBox "Record has been Saved"
  15.             gintAddressID = cboContAddrID
  16.             DoCmd.OpenForm "frmAddr", , , "AddrID=" & GetAddrID(), , acDialog
  17.         End If
  18.         Me.Requery
  19.     End If
Thank you!
Apr 21 '10 #1
1 2228
NeoPa
32,556 Expert Mod 16PB
I tried to work out what you meant by looking through your code, but little of that makes sense to me either.

What exactly are we trying to help with here? Perhaps some example data may help if you can't make the question clearer.
Apr 22 '10 #2

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

Similar topics

12
by: Kin®sole | last post by:
Hi I'm very new to VB (using VB6) I have two lists one blank and one containing names in the format of surname and then forename.I also have a combo box containing forenames.When I select a...
3
by: Charles | last post by:
I am trying to add the ability for a user to change the order in which the elements are listed in a dropdown list box. Before I added the ListID field the dropdown list box order was controlled...
2
by: Brian | last post by:
Hope you all had a great holiday. I have a subform with a table with a combo box based on a select query. The combo box is set to display in a form in datasheet view. When I click the down...
1
by: Chicken Kebab Abdullah | last post by:
I am making a database of my movie collection and I have a form which Shows a DVD Code in a combo, and a list of the divx movies on the dvd on the right in a list box. The combo boxes bound...
3
by: news.bellatlantic.net | last post by:
I have a fundraising database for an organization. Donations come in from current members anad are found by using a combo box. If the member is found, the After Update macro switches to another...
2
by: kmnotes04 | last post by:
Is it possible to link one drop-down box to another? For example, if a name is chosen from a drop-down list, can another drop-down list then automatically display the person's office as a result of...
6
by: AA Arens | last post by:
Hi, I have a database with 2 main forms. Contacts and companies. I share the base with two others via LAN. On the companies form I have buttons to navigate throught the records (>400). We are...
4
Rabbit
by: Rabbit | last post by:
Cascading Combo/List Boxes This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one...
30
ADezii
by: ADezii | last post by:
This week’s Tip of the Week will clearly demonstrate how you can dynamically set the Drop Down List Width of a Combo Box to the length of the longest item in its Row Source. The inspiration for this...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.