473,385 Members | 1,872 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,385 software developers and data experts.

Suppressing Not In List msg in combo box

Using A2K. I've got a combo box that if an item is entered that isn't
in the lookup table, the user is prompted whether or not they want to
add it to the list. If "No", I want the value to stay in the field
but not be added to the list. The message that the item isn't in the
list displays after "No" is chosen. How do I suppress this message?

I managed to get past the message with the following code but I'd like
to suppress the message all together. By "...get past..." I mean I
can tab out of the field the NotInList message won't display anymore.
Any help or advice is appreciated.

strTitle = conQuote & NewData & conQuote & " not in Payee list"
strMsg = "Do you wish to add it to the list?"

If MsgBox(strMsg, vbYesNo, strTitle) = vbYes Then
DoCmd.OpenForm "frmPayee", , , , , acDialog, Me.cboPayee.Text

If IsLoaded("frmPayee") Then
Set frm = Forms!frmPayee
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tlkpPayee", dbOpenTable)

With rst
.AddNew
!Payee = frm!txtPayee
!Address = frm!txtAddress
!SSN = frm!txtSSN
.Update
End With

Response = acDataErrAdded

Me.txtPayeeAddress = frm!txtAddress
Me.txtSSNTaxID = frm!txtSSN

DoCmd.Close acForm, "frmPayee"
rst.Close
dbs.Close
Else
Response = acDataErrContinue
End If
Else
Me.cboPayee.LimitToList = False
Response = acDataErrAdded
End If
Nov 13 '05 #1
0 1300

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Kin®sole | last post by:
Hi I'm very new to VB (using VB6) I have two lists one blank and one containing names in the format of surname and then forename.I also have a combo box containing forenames.When I select a...
3
by: Charles | last post by:
I am trying to add the ability for a user to change the order in which the elements are listed in a dropdown list box. Before I added the ListID field the dropdown list box order was controlled...
1
by: Chicken Kebab Abdullah | last post by:
I am making a database of my movie collection and I have a form which Shows a DVD Code in a combo, and a list of the divx movies on the dvd on the right in a list box. The combo boxes bound...
2
by: kmnotes04 | last post by:
Is it possible to link one drop-down box to another? For example, if a name is chosen from a drop-down list, can another drop-down list then automatically display the person's office as a result of...
40
by: Dave Hansen | last post by:
Please note crosspost. Often when writing code requiring function pointers, it is necessary to write functions that ignore their formal parameters. For example, a state machine function might...
6
by: AA Arens | last post by:
Hi, I have a database with 2 main forms. Contacts and companies. I share the base with two others via LAN. On the companies form I have buttons to navigate throught the records (>400). We are...
4
Rabbit
by: Rabbit | last post by:
Cascading Combo/List Boxes This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one...
30
ADezii
by: ADezii | last post by:
This week’s Tip of the Week will clearly demonstrate how you can dynamically set the Drop Down List Width of a Combo Box to the length of the longest item in its Row Source. The inspiration for this...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.