By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,558 Members | 2,957 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,558 IT Pros & Developers. It's quick & easy.

Saving List Box and Combo Box

P: 6
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
Share this Question
Share on Google+
1 Reply


NeoPa
Expert Mod 15k+
P: 31,494
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

Post your reply

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