473,385 Members | 1,712 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.

NotInList - NewData split over 3 Fields

I have a combobox which has the following SQL Statement as its Data
Source

SELECT DISTINCTROW tblCustomer.CustomerID,
Trim([tblCustomer]![CustomerTitle] & " " &
[tblCustomer]![CustomerInitials] & " " &
[tblCustomer]![CustomerSurname]) AS Customer
FROM tblCustomer
ORDER BY Trim([tblCustomer]![CustomerTitle] & " " &
[tblCustomer]![CustomerInitials] & " " &
[tblCustomer]![CustomerSurname]);

I then use the NotinList event procedure to allow the user to add a
new customer. FrmCustAdd is opened (modal) and the user has to type
in Title, Initials and Surname into 3 separate fields. When they
close the form the combobox is requeried but does not default to the
newly entered customer. I realise that this is supposed to work on
just one field but is there a workaround?
Nov 13 '05 #1
1 1426
HJ
Save the new customer ID to a global variable, e.g. lngNewCustomerID. Do
this before you update the recordset (assuming that you add the new customer
data by code). When you close the entry form and the customer form regains
focus, set the customer combo box to the new customer ID (Form_GotFocus or
Form_Activate):

Me.ComboBox1.Value = lngNewCustomerID

HJ

"David Mitchell" <da**************@talk21.com> wrote in message
news:c3************************@posting.google.com ...
I have a combobox which has the following SQL Statement as its Data
Source

SELECT DISTINCTROW tblCustomer.CustomerID,
Trim([tblCustomer]![CustomerTitle] & " " &
[tblCustomer]![CustomerInitials] & " " &
[tblCustomer]![CustomerSurname]) AS Customer
FROM tblCustomer
ORDER BY Trim([tblCustomer]![CustomerTitle] & " " &
[tblCustomer]![CustomerInitials] & " " &
[tblCustomer]![CustomerSurname]);

I then use the NotinList event procedure to allow the user to add a
new customer. FrmCustAdd is opened (modal) and the user has to type
in Title, Initials and Surname into 3 separate fields. When they
close the form the combobox is requeried but does not default to the
newly entered customer. I realise that this is supposed to work on
just one field but is there a workaround?

Nov 13 '05 #2

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

Similar topics

0
by: Anita Mossey | last post by:
I have a table named tblSkills consisting of two fields named ContactID and Skills. The table does not have a key. The NotInList code below is for a subform that consists of a text field with a...
1
by: Steve Leferve | last post by:
Can someone tell what what objects I have to work with on the 'NotInList' event? Basically I want to have a pop-up prompt the user if they want to add the data they typed into the database. ...
8
by: Heather | last post by:
I want to make a message box appear on the NotInList event for several combo boxes. The message box will alert the user that if they need to add a value they must go through the database...
2
by: whilstiwait | last post by:
I have a form containing a number of unbound combo boxes in three columns. Each column has boxes named "aaaa0", "aaaa1", etc. Using syntax like: With Forms(Me.Form.Name).Controls("txtTechnology"...
4
by: CAD Fiend | last post by:
Hello, I have a combo box (cmbFirstName) on a form that is hitting a query (qryFirstName) and then putting that selected (or typed by user) value to the table field (name FirstName) on the table...
11
by: my-wings | last post by:
I think I've painted myself into a corner, and I'm hoping someone can help me out. I have a table of books (tblBooks), which includes a field (strPubName) for Publisher Name and another field...
7
by: Bryan | last post by:
I am trying to allow the user to add an item to a list if it is not found in a combobox. When the NotInList event is triggered I run a function "AddItem" that has a custom dialog box to add an...
1
imrosie
by: imrosie | last post by:
Hello (from Rosie the newbie), I recently got help with a wonderful event to perform this from 'thescripts'...it recognizes that a name is not in the list an allows for (after parsing first and...
4
by: EManning | last post by:
I have a combobox whose rowsource is a union query. This query displays a person's name in "lastname, firstname" format and in "firstname lastname" format. The query results look like 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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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:
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
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...

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.