By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,863 Members | 853 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,863 IT Pros & Developers. It's quick & easy.

NotInList - NewData split over 3 Fields

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.