Access 2003: Conditional formatting based on table - ms-access

I have a MS Access 2003 CRM system that sets follow up actions. I need this to use conditional formatting to ensure I don't select a weekend date or something like a bank holiday / annual leave.
I've tried conditional formatting the next action date with the following expression suggested by the designer:
DLookup(“[OffDates]”, “[tblOffDates]”, “[OffDates]=#” & [the form control name] & “#”)
However this isn't working. See links below for some context:
http://i.imgur.com/VVgExW1.jpg
http://i.imgur.com/gpXRWCT.jpg
I thought it would be simpler to just have it flag up when it matches a date but it's not working. Any ideas?
Thanks in advance.

Related

Access Textbox control source outside current report

I am creating a Report in MS Access 2016. I want textboxes showing a summary of data from other tables - without actually showing rows of those tables (no subreports if possible). For example, I have tried to create a textbox with formula
=Format(Avg([WeekData].[DIFOT]),"##0.0%") & " DIFOT This Week"
which should return something like
100% DIFOT This Week
(NB Weekdata is a query and DIFOT is a field in that query, all in the same database as this report.)
However instead it just gives me #Error.
Please can you tell me the most efficient way to pull together summary figures such as these without creating any more queries and/or subreports than absolutely necessary? I'm quite new to SQL and Access on the whole.
Many thanks in advance.
Use DAvg() domain aggregate function. Also, the ## characters in Format() pattern serve no purpose.
=Format(DAvg("DIFOT", "WeekData"), "0.0%") & " DIFOT This Week"
or
=Format(DAvg("DIFOT", "WeekData"), "Percent") & " DIFOT This Week"

MS Access Date Grouping is not working in report

I have created a simple Microsoft Access 2007 app of receiving and paying vouchers, everything is working properly but one thing that my mind doesn't solve.
I have created a report template of "Receiving Amount" where I want report be grouped in respect of receiving date. I have added a field named "Receiving Date" in "Group, Sort and Total" and when I generate it, it doesn't group the content in respect of date.
Adjust your Grouping and Sorting to use the expression:
Fix([Receiving Date])
I found the solution.
The reason of not grouping date wise because Access could not understand the date, like Gustav said, format is just for display but actual value is different and Sergey S said "If the field with date contains time. you won't be able to group the report".
Finally, I had to remove time from the date and keep it clear to Access so it can group my report.
=MonthName(DatePart("m",[receiving date])) & " " & Format$([receiving date],"d"", ""yyyy")
Where receiving date is the field name.

Add Calculation Field To Report

I am running access 2013, with a linked view from SQL Server 2008 R2. I have two fields that I want to sum and data types are:
SQL Server 2008: Decimal(10,2)
Access: Number
They are being formatted in my query to currency using this syntax:
cf1: Format([calcfield1],"Currency")
cf2: Format([calcfield2],"Currency")
I have a report with both of these fields bound to text boxes and am adding a 3rd textbox to SUM() them. This is the control source syntax I input to SUM() the fields:
Name: SumOfFields
Control Source: =Sum([cf1]+[cf2])
Now when I attempt to view the access 2013 form, I get the error message displayed below. What do I need to change in order to perform this calculation on my report?
EDIT
If it makes a difference one cf1 is in the Serial Header section of my report, and the field cf2 is in the Details section of my report, and can have multiple entries. I want the SUM() that I am trying to add to be added to the Details section of the report like below:
Serial Header
$22.40
Details
$10.00
$13.40
$10.20
$56.00
Check out the link here it may help. A few things come to mind to check, but with the limited info this is the best I can do...
1) One of the fields is in a custom header which would mean that the total you are attempting to add needs to be in the custom footer
2) You need to place the total in the footer of the report
Link
I agree with #user2676140 - the total should appear in the group footer and should probably look something like:
=[cf1] + Sum([cf2])
If this doesn't work then I would try taking the Format wrapper off [cf1] and [cf2] and use the controls' properties to format them as Currency. Then maybe have the ControlSource for SumOfFields as
=[calcfield1] + Sum([calcfield2])
Again, use the properties of SumOfField to set the format.

MS Access 2010 input date once for multiple sub reports

I've been banging my head against this for weeks, have Googled every permutation of the question that i can think of, and have still got nowhere, so any help would be really appreciated.
WHAT I NEED:
I need to generate a report, which pulls summaries of our referrals from the database. I have two reports which use the following queries as their Record Source:
SELECT referrals.origin_country, Count(*) AS ['number']
FROM referrals
WHERE (((referrals.referral_date) Between [Enter Start Date] And [Enter End Date:]))
GROUP BY referrals.origin_country;
And
SELECT referrals.first_language, Count(*) AS ['number']
FROM referrals
WHERE (((referrals.referral_date) Between [Enter Start Date:] And [Enter End Date:]))
GROUP BY referrals.first_language;
The queries are nearly identical, and the date range is the same for each one.
The issues is that when I generate a report which uses these two reports as subreports, I then have to enter the date range for the subreports twice (once for the Country of Origin Subreport, and once for the First Language Subreport.
My Access skills are not as advanced as I would like, and I'm wondering if anybody can tell me how to ensure that the user only has to enter the date range once?
I've tried
Using VBA to create a variable onLoad, but then couldn't work out how to use this variable in the Record Source Query...
Using VBA to create a function which sets a variable onLoad, but then couldn't work out how to use the function in my Record Source query...
Any suggestions would be greatly appreciated!
Create a form with fields for the start and end date, and a button on it, which launches your main form. Use the 'Embedded Macro' Wizard to open the chosen Report On Click.
Then, use [Forms]![FORM NAME]![FIELD NAME] in the query to access the date, for example:
SELECT referrals.origin_country, Count(*) AS ['number']
FROM referrals
WHERE (((referrals.referral_date) Between [Forms]![EAL Referral Search Form]![dat_termly_report_start] And [Forms]![EAL Referral Search Form]![dat_termly_report_end]))
GROUP BY referrals.origin_country;

Crystal Reports & Access 2013 - Continuous Form?

Original Question
In Crystal Reports 2011, how do I show all values from a certain Field?
My formula that pulls the data from an Access DB is simply:
{tblQuoteFormSub_Windows.fQty} & " - " &
{tblQuoteFormSub_Windows.fWindowSizeW} &
" x " & {tblQuoteFormSub_Windows.fWindowSizeH}
If I right click on the field in Design or Preview Mode, I can select "Browse Field Data, and see all the values, but I cannot figure out how to print all of them.
EDIT:
I used a sub report (I am still learning, and didn't know they existed in CR until today). Now I can view the records I need based on the fJobID Field.
However...
I need a way to select which group to print... Preferably by using a control in Access to select a Job #. Should I post that as a new question?
The subreport is a good idea. I was thinking of suggesting that, but I wasn't sure if it would have met your needs. I haven't tried Access 2013 yet, and it's been awhile since I've even seen CR. But as for your other question, I can give you one suggestion that I used with previous versions.
In your Access query, add a parameter to your query, i.e. Select * from mytable where job='[Enter Job Num]'. Then when you preview your CR, that parameter should filter through so that it will ask you for the job number when you preview it.
Give it a try and let me know if it worked.