473,395 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Access problem; "Not in List"

Hey all,

I have a problem with my the Form I built, hopefully someone here can help me out! I'm still a beginner, so bear with me!

Here goes...

The form contains many boxes, each of which refer to a specific table. For example, one box is called "City Name" and it gets it info from a 1-column table containing city names.

I was able to get a working "event procedure" code that enables me to add in a city name when it is not already in my list. I was able to apply this code to all the other boxes except one (and this is where I have a problem).

The box I can't apply it too is called "ContactInfo1" and is the result of a query, and shows a result in the format "Prefix FirstName LastName" (obtained from a 3-column table)

How do I modify my code so that when I type a name in using that format, lets say "Mr. John Smith", for example, "Mr." goes in the first column of the list table, "John" goes in the second, and "Smith" goes in the third? Right now, If I type "Mr. John Smith", the whole name appears in the "Prefix" column of my list.

Thanks!!

Here is the code i'm using:

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

Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim ContactInfo1_ID As AccessObject

Set db = CurrentDb
Set rs = db.OpenRecordset("ContactInfo1", dbOpenDynaset)
On Error Resume Next
rs.AddNew
rs!Prefixe = NewData
rs.Update


If Err Then
MsgBox "An error occurred. Please try again."
Response = acDataErrContinue
Else
Response = acDataErrAdded

End If

rs.Close
Set rs = Nothing
Set db = Nothing


End Sub
Oct 11 '06 #1
2 2741
Tanis
143 100+
On Not In List is fine for adding one record to a table. In your situation, I would suggest opening a form. The Micosoft Knowledge base describes this method in detail with code. You might have to modify the code to enter say three fields, but at least it gives you a start.


http://support.microsoft.com/kb/197526/en-us
Oct 12 '06 #2
Thanks for the help, I'll try it out!!

On Not In List is fine for adding one record to a table. In your situation, I would suggest opening a form. The Micosoft Knowledge base describes this method in detail with code. You might have to modify the code to enter say three fields, but at least it gives you a start.


http://support.microsoft.com/kb/197526/en-us
Oct 13 '06 #3

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

Similar topics

0
by: spencer | last post by:
Hi, I'm using NumPy to build an array of a list of names that will be of multiple dimensions.I did do a google on this subject, but couldn't find what I was looking for. The problem I'm having...
9
by: Bob Alston | last post by:
I have a drop down combo box that gives the user to enter an item not in the list by adding it to the list. The list is a table. It works fine on Access2003 but fails on Access2002/XP. ON XP, it...
1
by: wcamp | last post by:
I would like a "field list" to appear in report design. Clicking the "filed list" icon nothing happens. Have tried dozens of ways to get a "field list", so far no luck! Have created over 5 ACCESS...
2
by: Rico | last post by:
Hello, Is there any way to get rid of or replacing the error message that pops up when you enter a combo box item that isn't in the list? I've tried using the Not In List event, but there is...
1
by: ApexData | last post by:
WatchOut for "Allow AutoCorrect" in your unbound combobox lookups. I am building a personnel database, and the last name of Ballance was causing the following message to popup, prohibiting me from...
4
by: belfallas | last post by:
Hi, ive got this problem with one of my databeses. My question is, how do i create a sort of a shopping list on access? Im doing a ficitional pizza shop, and what i want to do is to have an...
10
JamieHowarth0
by: JamieHowarth0 | last post by:
Hi folks, Got a massive headache. I'm working as a contractor on a project for a SAM company and they are using an Access database with a particular query to extrat information to import from a DB...
0
by: howkoss | last post by:
Hi, I've been very frustrated for 2 days trying to make this work. I started with a built-in template "Projects" that came with Access 2007. On the "Employee List" I can click on any cell and bring...
6
by: vanlanjl | last post by:
I cannot get the not in list event to work right. On my form I have a combo box named "cboChargeCode" I have a table named "tblChargeCode" I would like it so when you enter a value into the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.