[AccessD] form doesn't save

Charlotte Foust cfoust at infostatsystems.com
Wed Oct 31 16:13:06 CDT 2007


As I recall, you have to be in design view to permanently change the
values in the value list.  You'd be better off storing the values in a
table instead if you want to allow the users to permanently add a value.

Charlotte Foust 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Susan Harkins
Sent: Wednesday, October 31, 2007 1:43 PM
To: AccessD at databaseadvisors.com
Subject: [AccessD] form doesn't save

The following is a simple event procedure that updates a value list
combo with user input. It works fine. The problem is, the form won't
save the new item. The next time you open the form, the newly added
item's gone. It's kind of like, the form doesn't think there's anything
to change, because I don't get the Save prompt. 

Susan H. 



Private Sub cboMetals_NotInList(NewData As String, _  Response As
Integer)
  'Update value list with user input.
  On Error GoTo ErrHandler
  Dim bytUpdate As Byte
  bytUpdate = MsgBox("Do you want to add " & _
   cboMetals.Value & " to the list?", _
   vbYesNo, "Non-list item!")
  'Add user input
  If bytUpdate = vbYes Then
    Response = acDataErrAdded
    cboMetals.AddItem NewData
    'Update RowSource property for
    'XP and older.
    'cboMetals.RowSource = _
    ' cboMetals.RowSource _
    ' & ";" & NewData
    'Save updated list.
    DoCmd.Save acForm, "ValueList"
  'Don't add user input
  Else
    Response = acDataErrContinue
    cboMetals.Undo
  End If
  Exit Sub
  
ErrHandler:
  MsgBox Err.Number & ": " & Err.Description, _
   vbOKOnly, "Error"
  
End Sub
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list