Contact Management Database (Template) (1 Viewer)

Kyp

Member
Local time
Today, 15:53
Joined
Aug 5, 2021
Messages
68
I've downloaded the Contact Management Database template and was wondering about these two query statements.
The first and second columns are expressions.
Code:
File As: IIf(IsNull([Last Name]),IIf(IsNull([First Name]),[Company],[First Name]),IIf(IsNull([First Name]),[Last Name],[Last Name] & ", " & [First Name]))
Contact Name: IIf(IsNull([Last Name]),IIf(IsNull([First Name]),[Company],[First Name]),IIf(IsNull([First Name]),[Last Name],[First Name] & " " & [Last Name]))
The third column in the query is Contacts*. The record source for "Contact Details" form is this query.
The two statements are almost identical with the exception of the expression name. I understand what the expressions do, just not sure on the purpose as it seems redundant to me...

Cheers!
-Kyp
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:53
Joined
May 7, 2009
Messages
16,453
maybe it the Column "File As" is used for outputting to pdf or csv etc.
 
  • Like
Reactions: Kyp

Kyp

Member
Local time
Today, 15:53
Joined
Aug 5, 2021
Messages
68
@arnelgp

Many thanks for the early morning reply! :coffee:

I haven't even looked at the reports. Seems I have answered my own question....lol
 

mike60smart

Registered User.
Local time
Today, 21:53
Joined
Aug 6, 2017
Messages
1,178
@arnelgp

Many thanks for the early morning reply! :coffee:

I haven't even looked at the reports. Seems I have answered my own question....lol
Hi Kyp

These templates are not much use as they use Lookups at table level
 
  • Like
Reactions: Kyp

isladogs

CID VIP
Local time
Today, 21:53
Joined
Jan 14, 2017
Messages
16,257
Agree with Mike. Many instances of bad practice in most of the MS Access templates including attachment fields, multivalue fields, spaces and special characters in field names etc.

As for those specific fields, the idea is to mimic contact info displayed in Outlook where e.g. John Smith may be displayed as Smith, John.
 
  • Like
Reactions: Kyp

Kyp

Member
Local time
Today, 15:53
Joined
Aug 5, 2021
Messages
68
@mike60smart
Good morning Mike! I've downloaded a couple just to see some basic structure and they pretty much all look alike, same programming style.

@isladogs
Top of the morning sir! I still haven't gotten a change to get back into the AttentionSeek db. When I do, I will let you know!

Thanks for replying!

Cheers!
-Kyp
 

isladogs

CID VIP
Local time
Today, 21:53
Joined
Jan 14, 2017
Messages
16,257
@Kyp
The templates are designed to show off Access 'features'. Many were created by the same team when Access 2007 was released as that contained a number of new features (not all good).

No problem re the other issue. Let me know if/when you do so.
 
  • Like
Reactions: Kyp

SHANEMAC51

Active member
Local time
Today, 23:53
Joined
Jan 28, 2022
Messages
288
The first and second columns are expressions.
of course, these expressions are very useful, but they are very beloved and very difficult to write, especially for a beginner when creating a query

even for analysis (error search), I often translate it into a structured view

Code:
File As:
    IIf(IsNull([Last Name]),
        IIf(IsNull([First Name]),
            [Company],
            [First Name]),
     
        IIf(IsNull([First Name]),
            [Last Name],
            [Last Name] & ", " & [First Name]))

Contact Name:
    IIf(IsNull([Last Name]),
        IIf(IsNull([First Name]),
            [Company],
            [First Name]),
         
        IIf(IsNull([First Name]),
            [Last Name],
            [First Name] & " " & [Last Name]))
 

Users who are viewing this thread

Top Bottom