A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Adding data to combo box



 
 
Thread Tools Display Modes
  #1  
Old May 30th, 2006, 09:18 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Adding data to combo box

I have a combo box based on a row source and I use this code that I
found from a website for the user to add items other than those in the
combo box. The problem is the items dont save in the combo box. Is
there any way to get them to save?

Private Sub Clothing_Size_NotInList(NewData As String, Response As
Integer)

'Suppress the default error message.

Response = acDataErrContinue

'Prompt user to verify if they wish to add a new value.

If MsgBox(" " & NewData & " is not in list. Add it?", vbYesNo) = vbYes
Then

'Add a new Size to the list with the value from the variable NewData.

[Clothing Size].RowSource = [Clothing Size].RowSource & ";" & NewData

'Inform the combo box that the desired item has been added to the list.

Response = acDataErrAdded

End If

End Sub

  #2  
Old May 30th, 2006, 09:31 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Adding data to combo box

Check this link on how to add record to combo

http://www.databasedev.co.uk/not_in_list.html

--
Good Luck
BS"D


" wrote:

I have a combo box based on a row source and I use this code that I
found from a website for the user to add items other than those in the
combo box. The problem is the items dont save in the combo box. Is
there any way to get them to save?

Private Sub Clothing_Size_NotInList(NewData As String, Response As
Integer)

'Suppress the default error message.

Response = acDataErrContinue

'Prompt user to verify if they wish to add a new value.

If MsgBox(" " & NewData & " is not in list. Add it?", vbYesNo) = vbYes
Then

'Add a new Size to the list with the value from the variable NewData.

[Clothing Size].RowSource = [Clothing Size].RowSource & ";" & NewData

'Inform the combo box that the desired item has been added to the list.

Response = acDataErrAdded

End If

End Sub


 




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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
from text to combo brown_eyes Using Forms 8 April 13th, 2006 04:22 PM
Excel Macro to Copy & Paste [email protected] Worksheet Functions 0 December 1st, 2005 01:56 PM
PST file has reached maximum size Jeff C General Discussion 2 October 6th, 2005 01:35 PM
Combo Box, Adding more data to ready values - the NotInList thing Jack General Discussion 5 January 26th, 2005 02:33 AM
Pulling data from 1 sheet to another Dave1155 Worksheet Functions 1 January 12th, 2005 05:55 PM


All times are GMT +1. The time now is 06:23 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.