Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Use stLinkCriteria for 3 fields

0 views
Skip to first unread message

Allen Browne

unread,
Mar 19, 2006, 1:31:12 AM3/19/06
to
Assuming these are all Text fields (not Number fields), you need something
like this:

stLinkCriteria = "(FName = """ & Me.FName & _
""") AND (LName = """ & Me.LName & _
""") AND (Phone1 = """ & Me.Phone1 & """)"

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Donna" <Do...@discussions.microsoft.com> wrote in message
news:49EA578B-CBC7-4E68...@microsoft.com...
>I have a table that has 3 fields as its primary key. How do I create a
> stLinkCriteria phrase that will open another form using those three fields
> as
> the linking criteria?
>
> Field names are FName, LName & Phone1


Donna

unread,
Mar 19, 2006, 12:01:32 PM3/19/06
to
Thanks, Allen! Along similar lines, I have a combo box for doing "searches"
on a form. Again, the Primary Key is composed of these same 3 fields. But I
can only get it to bind to 1 column; I need it to bind to all 3 columns.
Right now, if I search for "Smith" & there are 3 "Smiths", it will only go to
the 1st "Smith", even though I am selecting the 2nd or 3rd one. I assume
that's because it can only be bound to column 1. Can I bind it to 3 columns?

John Vinson

unread,
Mar 19, 2006, 6:33:25 PM3/19/06
to
On Sun, 19 Mar 2006 09:01:32 -0800, Donna
<Do...@discussions.microsoft.com> wrote:

>Thanks, Allen! Along similar lines, I have a combo box for doing "searches"
>on a form. Again, the Primary Key is composed of these same 3 fields. But I
>can only get it to bind to 1 column; I need it to bind to all 3 columns.
>Right now, if I search for "Smith" & there are 3 "Smiths", it will only go to
>the 1st "Smith", even though I am selecting the 2nd or 3rd one. I assume
>that's because it can only be bound to column 1. Can I bind it to 3 columns?

You'll do much better to have a unique PersonID (which might not be
meaningful or visible to the user), and use it as the bound column of
the combo.

John W. Vinson[MVP]

Allen Browne

unread,
Mar 19, 2006, 7:32:45 PM3/19/06
to
Donna, I agree with John that adding an AutoNumber to your table will be
easier than trying to handle the 3-field combo.

It will also simplify your life when you come to create related tables for
these entries.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"John Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message
news:igqr129gf6ig863ns...@4ax.com...

0 new messages