My Assistant
|
|
Apr 11 2012, 09:26 AM
Post
#1
|
|
|
UtterAccess Guru Posts: 508 |
I have a select statement on an unbound control on a form that selects from the name field and then adds some more data from a couple other fields and then orders the selection by name. It works great except when there is a duplicate name in the database. Say that John Doe has two accounts, 12345 and 54321 so his name is in the name field twice. It will allow me to select the first John Doe for account number 12345 but not for 54321. How can I write this select statement to allow it to select either of the names from either account number?
SELECT tblMainFin.txtName1, (tblMainFin.txtName1+" ") & tblMainFin.txtSecondName & tblMainFin.AcctNum FROM tblMainFin ORDER BY [txtName1]; Thanks |
|
|
|
![]() |
Apr 11 2012, 12:24 PM
Post
#2
|
|
|
UtterAccess Guru Posts: 508 |
Something still isn't right. I changed the column to 1 which is my primary key and it's still pulling in incorrect data in the form. Any ideas?
|
|
|
|
Dexter Select Statement Not Allowing More Than One Of The Same Name Apr 11 2012, 09:26 AM
Bob G what type of control?
as a test, can you add the a... Apr 11 2012, 09:33 AM
Alan_G Hi
You'd have separate tables, so that one cl... Apr 11 2012, 09:34 AM
GroverParkGeorge Your problem is that the selection needs to be mad... Apr 11 2012, 09:36 AM
Dexter QUOTE You'd have separate tables, so that one ... Apr 11 2012, 09:51 AM
Dexter QUOTE Your problem is that the selection needs to ... Apr 11 2012, 10:07 AM
GroverParkGeorge That's the way to do it, yes. Apr 11 2012, 10:21 AM
Dexter It lets me select the correct name and account num... Apr 11 2012, 10:38 AM
GroverParkGeorge Ah, we've probably changed the datatype of the... Apr 11 2012, 11:17 AM
Dexter Would I just change Dim stLinkCriteria As Integer?... Apr 11 2012, 11:40 AM
Dexter Also, this in on the on load even of the form that... Apr 11 2012, 11:50 AM
Alan_G Hi
You're declaring stLinkCriteria but you... Apr 11 2012, 11:52 AM
Alan_G Hi
Ahh, just seen you've posted that you... Apr 11 2012, 11:54 AM
Dexter Okay, from my form with the drop down to select th... Apr 11 2012, 02:20 PM
Alan_G Hi
Couple of things to look at
1 Are you sure th... Apr 11 2012, 02:36 PM
Dexter Private Sub Form_Load()
Dim Temp3 As Long
Temp3 =... Apr 11 2012, 03:03 PM
Alan_G Hi
OpenArgs is passed as a string value, so you... Apr 11 2012, 03:18 PM
Dexter Perfect! Thank you. Apr 11 2012, 03:29 PM
Alan_G RE: Select Statement Not Allowing More Than One Of The Same Name Apr 11 2012, 03:49 PM![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 18th June 2013 - 09:40 PM |