Hello,
I have two forms (ENGLISH AND FRENCH) each with buttons that open reports in the language of the form. The only difference in the reports is that their query returns data from different fields.
In this sense i have.
TblCommodity Names with
commodityID
commodityenglish
commodityfrench
What code do i need to redirect the query taking in consideration the name of the form where the user opens the reports???
Thnks.
5 1169
Better to create a French and English query and use that for the forms.
Creating a query depending on the name of a form is "tricky" as a change of name ruins the query...
Nic;o)
Better to create a French and English query and use that for the forms.
Creating a query depending on the name of a form is "tricky" as a change of name ruins the query...
Nic;o)
Thanks Nico, that sounds better, can you elaborate a bit more. I thought that queries were just for reports.
Gilberto
Queries and tables are more or less "the same" as both extract data from the database. Tables are "elementary" and queries add the possibility to extract data (SELECT) from multiple tables, but also allow the selection of a subset of fields from one table.
Both reports and forms can be linked ("bound") to any table or query to extract their data.
Nic;o)
Thnks nico. I just still dont understand how to define the query so that on user "response" it opens the adequate report (ENGLISH report or FRENCH report).
This is my exact situation. I have a FRENCH report whose query reads: - SELECT Engineering.Commodity,
-
nz(Sum(IIf([Engineering].[Seating]="front",(Engineering![Weight]/1000)* (Engineering![Level 1 Driver]+Engineering![Level 1 Passenger]+ Engineering![Level 1 Rear]),0)),0) AS FRONT,
-
nz(Sum(IIf([Engineering].[Seating]="rear",( Engineering![Weight]/1000)* (Engineering![Level 1 Driver]+Engineering![Level 1 Passenger]+ Engineering![Level 1 Rear]),0)),0) AS REAR,
-
nz(Sum((Engineering![Weight]/1000)* (Engineering![Level 1 Driver]+Engineering![Level 1 Passenger]+Engineering![Level 1 Rear])),0) AS MIX
-
FROM Engineering
-
WHERE Engineering.Variant1=-1
-
GROUP BY Engineering.Commodity
-
ORDER BY Engineering.Commodity
-
UNION SELECT "Total" AS Commodity,
-
nz(Sum(IIf([Engineering].[Seating]="front", (Engineering![Weight]/1000)* (Engineering![Level 1 Driver]+Engineering![Level 1 Passenger]+ Engineering![Level 1 Rear]),0)),0) AS FRONT,
-
nz(Sum(IIf([Engineering].[Seating]="rear", (Engineering![Weight]/1000)* (Engineering![Level 1 Driver]+Engineering![Level 1 Passenger]+ Engineering![Level 1 Rear]),0)),0) AS REAR,
-
nz(Sum((Engineering![Weight]/1000)* (Engineering![Level 1 Driver]+Engineering![Level 1 Passenger]+Engineering![Level 1 Rear])),0) AS MIX
-
FROM Engineering
-
WHERE Engineering.Variant1=-1;
and a modyfied query that brings ENGLISH names instead of french ones like this: - SELECT [commodity name].CommodityEnglish,
-
nz(Sum(IIf([Engineering].[Seating]="front",(Engineering![Weight]/1000)* (Engineering![Level 1 Driver]+Engineering![Level 1 Passenger]+ Engineering![Level 1 Rear]),0)),0) AS FRONT,
-
nz(Sum(IIf([Engineering].[Seating]="rear",( Engineering![Weight]/1000)* (Engineering![Level 1 Driver]+Engineering![Level 1 Passenger]+ Engineering![Level 1 Rear]),0)),0) AS REAR,
-
nz(Sum((Engineering![Weight]/1000)* (Engineering![Level 1 Driver]+Engineering![Level 1 Passenger]+Engineering![Level 1 Rear])),0) AS MIX
-
FROM Engineering INNER JOIN [COMMODITY NAME] ON (Engineering.Commodity = [COMMODITY NAME].Commodity )
-
WHERE Engineering.Variant1=-1
-
GROUP BY [commodity name].CommodityEnglish
-
ORDER BY [commodity name].CommodityEnglish
-
UNION SELECT "Total" AS CommodityEnglish,
-
nz(Sum(IIf([Engineering].[Seating]="front", (Engineering![Weight]/1000)* (Engineering![Level 1 Driver]+Engineering![Level 1 Passenger]+ Engineering![Level 1 Rear]),0)),0) AS FRONT,
-
nz(Sum(IIf([Engineering].[Seating]="rear", (Engineering![Weight]/1000)* (Engineering![Level 1 Driver]+Engineering![Level 1 Passenger]+ Engineering![Level 1 Rear]),0)),0) AS REAR,
-
nz(Sum((Engineering![Weight]/1000)* (Engineering![Level 1 Driver]+Engineering![Level 1 Passenger]+Engineering![Level 1 Rear])),0) AS MIX
-
FROM Engineering
-
WHERE Engineering.Variant1=-1;
All i need is that without having to create duplicate REPORTS, someway the user can indicate if he wants the report in ENGLISH (which will follow the second query) or in FRENCH (which will follow the first query).
How can i do this???
Thanks again,
Gilberto
You'll need to store the needed language somewhere.
Let's assume you've created a form to start the report named "frmReports".
Now place a combobox named "cmbLanguage" on the form holding "English" and "Francais".
Now use your second query from the revious statement and change the first field like: -
SELECT IIF(Forms!frmReports!cmbLanguage="English",[commodity name].CommodityEnglish,Engineering.Commodity), .....
-
Getting the idea ?
Nic;o)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: John Sway |
last post by:
I'm writing a web-based "Query analyser" tool for our company intranet. It
allows a user to type any SQL statement in a form, and execute it over the
Web.
The SQL can be a query that returns...
|
by: Shahid Juma |
last post by:
Hello All,
This may be a trivial question, but I was wondering how can you determine if
a value contains an Integer or Float. I know there is a function called
IsNumeric, however you can't...
|
by: Hennie de Nooijer |
last post by:
Hi, This is a diffcult issue to explain. I hope to make my problem
clear to you.
SITUATION
I'm building A SLA Query for a customer. This customer has an awkward
way to determine the SLA results...
|
by: laurenq uantrell |
last post by:
I am trying to determine which of three stored procedure designs are
fastest in the Query Analyzer:
One query is a straight SELECT query with all desired rows and a dozen
(tblName.RowName =...
|
by: Mary |
last post by:
I am trying to develop a query which will determine the average costs
using a rolling average of the past 12 months of data. In other
words, if I entered the Ship Month of January and the Ship...
|
by: Ron St-Pierre |
last post by:
I am using postgres 7.3.4 and need to be able to determine which
database a query is being run in (from a script). pg_database lists
databases but doesn't tell me which one is currently active. Is...
|
by: Tony Ciconte |
last post by:
I have a table of customers who may have purchased numerous types of
products. Finding out who purchased what is easy. However, what I need
to determine is which customer has purchased ONLY one or...
|
by: jaso |
last post by:
Can you give any comments on this code?
I used one goto, is it bad?
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <assert.h>
#define NOT_NULL 1
|
by: RoomfulExpress |
last post by:
The only problem I'm having with this code is when there are no values returned for the query, it is still allowing you to see and click the 'Next>>'. It disappears when there is at least one return...
|
by: Hazza |
last post by:
Hi, I am using PHP and mysql to create a website.
I am fairly new to PHP, and thus am grateful to anyone who helps!
Firstly I am running a homepage, that displays additional content if a user...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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
|
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...
|
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...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |