DeveloperBarn Forums

Go Back   DeveloperBarn Forums > Databases > Microsoft Access

Discuss "Combo Box - Add Entry Not In List" in the Microsoft Access forum.

Microsoft Access - Microsoft Access is a database for small to medium applications. Learn tips and tricks and best database practices here.


Reply « Previous Thread | Next Thread »  
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old June 6th, 2008, 09:35 AM
AOG123's Avatar
Lightning Master

 
Join Date: Mar 2008
Location: Fortress Of Solitude
Posts: 77
Thanks: 6
Thanked 20 Times in 15 Posts
Rep Power: 1
AOG123 is on a distinguished road

Awards Showcase
Microsoft Access 
Total Awards: 1

Default Combo Box - Add Entry Not In List

Add a new value directly into a combo box

Insert the following into the NotInList event of your combo box

Code:
Private Sub ComboBox_NotInList(NewData As String, Response As Integer)
   Dim ctl As Control
   Dim strSQL As String
   Set ctl = Me!ComboBox

   If MsgBox("Value is not in list. Add it?", _
        vbOKCancel) = vbOK Then

       Response = acDataErrAdded
       
strSQL = "INSERT INTO  ComboListTable(list) VALUES('"
strSQL = strSQL & NewData & "');"
CurrentDb.Execute strSQL

   Else

       Response = acDataErrContinue
       ctl.Undo
   End If

End Sub
See attached
Attached Files
File Type: zip Combo - Not In List.zip (11.6 KB, 12 views)
__________________
If i helped you, make me famous by clicking the
Reply With Quote
Sponsored Links
Reply

  DeveloperBarn Forums > Databases > Microsoft Access

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Quick Links - Combo Open Forms AOG123 Microsoft Access 0 June 4th, 2008 08:46 AM
Dynamic Combo Maker mehere Classic ASP 0 March 28th, 2008 09:40 AM


Sponsored Links

ASP.NET Resource Index
a directory of ASP.NET tutorials, applications, scripts, assemblies and articles for the novice to professional developer.

Free Web Directory
Including Chats and Forums Resources, Offer automatic, instant and free directory submissions.
URLZ Web Directory
URLZ Web Directory

Free Web Directory - Add Your Link
The Little Web Directory
Free Web Directory
Pegasus free web directory is a free directory organised by categories.

Web Directory & SEO Services
dirroot web directory


All times are GMT -4. The time now is 08:09 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Copyright © 2008 DeveloperBarn.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46