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
- Private Sub cboOrgID_AfterUpdate()
- cboOrgID.Requery
- End Sub
- Private Sub cboDeptID_AfterUpdate()
- cboDeptID.Requery
- End Sub
Expand|Select|Wrap|Line Numbers
- Private Sub cmdSave_Click()
- If Me.NewRecord Then
- MsgBox "The record has not yet been saved. You must first save the record.", , "Record Not Yet Saved"
- Else
- If IsNull(cboContAddrID) Then
- gintAddressID = 0
- DoCmd.OpenForm "frmAddr", , , , acFormAdd, acDialog
- cboContAddrID.Requery
- If gintAddressID > 0 Then
- Me.ContAddrID = gintAddressID
- End If
- Else
- Call SaveRecord
- MsgBox "Record has been Saved"
- gintAddressID = cboContAddrID
- DoCmd.OpenForm "frmAddr", , , "AddrID=" & GetAddrID(), , acDialog
- End If
- Me.Requery
- End If