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

Which function to use? IIF or DLookup

158 100+
I have an appointment table where I keep date and time for an event(s) with different people or activity:

Tenants table
Suppliers Table
Employee Table
Project Table

I am having difficulty designing the front-end form to display a value in an expression field that I created called "WITH." The form is a simple datasheet and I am trying to keep it compact. So in other words I have to lookup in any table that are part of my query to see which one is not null and grab it so it shows into my [with] control.

this is what I have at the moment without the project table that I want to bring in:

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT AppointmentT.AppointmentID, AppointmentT.AppActive, AppointmentT.AppDate, AppointmentT.AppTimeFrom, AppointmentT.AppTimeTo, AppointmentT.IamID, AppointmentT.AppNote, IIf(IsNull([AppointmentT].[EmployeeID]),[AppointmentT].[TenantID] & " " & [TenantsT].[firstName] & " " & [TenantsT].[LastName],[employeesT].[FirstName] & " " & [EmployeesT].[LastName] & " " & [AppointmentT].[SupplierID] & " " & [suppliersT].[Company]) AS [With], AppointmentT.TenantID, AppointmentT.SupplierID, AppointmentT.EmployeeID
  3. FROM TenantsT RIGHT JOIN (SuppliersT RIGHT JOIN (ContactsT RIGHT JOIN (EmployeesT RIGHT JOIN AppointmentT ON (EmployeesT.EmployeeID = AppointmentT.EmployeeID) AND (EmployeesT.EmployeeID = AppointmentT.EmployeeID)) ON ContactsT.ContactID = AppointmentT.ContactID) ON SuppliersT.SupplierID = AppointmentT.SupplierID) ON TenantsT.TenantID = AppointmentT.TenantID
  4. WHERE (((AppointmentT.AppActive)=-1) AND ((AppointmentT.IamID)=[TempVars]![CurrentUserID]))
  5. ORDER BY AppointmentT.AppDate;
  6.  
When I have an appointment with an employee it works but it doesn't work with anyone else unless I include an employee with the other person or project that I deal with? any idea on how I can simplify this? thanks a bunch

Al
Jan 7 '11 #1
2 1892
orangeCat
83 64KB
Do some reading on data normalization.
Are you really involved in Tenants, Suppliers,
Employees and Projects OR Appointments?
You may also want to look at Junction Tables.
Good luck.
Jan 9 '11 #2
jaad
158 100+
I use the appointment form as a day timer for all my date and time driven activities. I could use one column for each Tenant, supplier, employee, project... but it makes the form too big and cluttered to look at.

Maybe my approach should be to hide any column that is null and somehow get the columns with value move to the left tightly packed side by side? can this be done?
Jan 11 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Scott Simpson | last post by:
I can build portions of DOM trees with jdom and xpathapi and using "new Element()" and "appendChild()" or "addContent()". Which function do I use to get a whole portion of a DOM tree though? For...
3
by: Paul T. RONG | last post by:
Hello, There is a table tblProduct, there is a field ProductNumber for example: ProductNumber 001 002
2
by: ABC | last post by:
Hi, All Which function return the desktop long and short date formats? Thanks
2
by: ABC | last post by:
Which function can retrieve the registry string from HKEY_Current_User\Control Panel\International\sShortDate?
2
by: ABC | last post by:
Which function or property return the current page URL?
3
by: ABC | last post by:
Is there any function to as: arrayvalue = {0, 2, 4, 6, 7, 8} arraystring = {"Zero", "Two", "Four", "Six", "More1", "More2"} If the parameter value is 6, the function return "More1". Which...
6
by: coolpint | last post by:
I am yet again confused about the process of overload resolution. Can anyone kindly explain why the function #2 is selected over #1 when passed 'char'? When passed 'const char', the compiler...
0
by: ABC | last post by:
Which function can determine the URI is web-based or File-based filename string? I want a function can determome the file with path is web or file-system-based filename, for example: ...
2
dnb
by: dnb | last post by:
which function is used to count the days of the month which is selected from calendar in vb 6.0? if i select "2/jan/2008" from calendar in this case days are "31" then how can i display number of...
0
by: Sebastian | last post by:
Hello I develop my applications in Access 2002. My development system is running Windows XP SP2 and I have Microsoft Office XP Developer. Microsoft Office XP is at SP3. I used Inno Setup (great...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.