473,799 Members | 2,999 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using MSACESS for translations?


I will try and explain the scenario as best i can...

Ultimately, i will have 3 tables... one table with values and the other two
that map to new values for the old table...

TABLE1:
Old_Value1
Old_Value2
Old_Value3 (Can be null)

TABLE2:
Old_Value1
Old_Value2
New_Value1
New_Value2

TABLE3:
Old_Value3
New_Value3
New_Value4

Based on each record in TABLE1.... the select statement should return
TABLE2.New_Valu e1, TABLE2.New_Valu e2, TABLE3.New_Valu e3, TABLE2.New_Valu e4

Ultimately, I am reading each record in Table1 to return the translated
values from the other tables.

IMPORTANT: Sometimes TABLE1.Old_valu e3 can be null so the lookup is not
necessary but I need the first lookup to occur...

So i need some IF logic and way to fetch values within the original select..
Here is the kicker... I can't use SQL Server... only what msacess provides
and i don't know any VB....
p.s. I am an oracle guy... but they want this solution portable (MSACCESS) on
a laptop with no connectivity... otherwise i would have written a package
with store procedures..

Even if anyone could suggest a good HELP topic to lookup...
Nov 13 '05 #1
3 1355

actually... if the value is NULL i can return "000"
Nov 13 '05 #2

Here's an example...

I ultimately want to return one record based on the translation rules
obtained from TABLE2/3 that go against the values coming in from TABLE1

Example Data

Table1 = (first 2 values translated and 2nd value has a 1:1 translate)
34,45,45
56,878, NULL

Table2 = (translation values)
34,45, 99
56,878, 33

Table3 = (translation values)
45, 66

Returned results/translations against table1

99, 66 (rec1)
33, 000 (rec2)
Thanks for the quick response... need to see an example of code to see how
the IF() works within SQL
--
Message posted via http://www.accessmonster.com
Nov 13 '05 #3

1. Createa blank form
2. Add a command button.
3. Put the following in the Event procedure.
I used the DLookUP Aggregate function for looking up the values
for table three.

HTH
Ron
Private Sub Command0_Click( )
On Error GoTo Err_Command0_Cl ick
Dim db As Database
Dim rs As Recordset
Dim txtNewValue1 As String
Dim txtNewValue2 As String
Dim SQLString As String

Set db = CurrentDb
Set rs = db.OpenRecordse t("Table1")
rs.MoveFirst
If rs.EOF Then
Exit Sub
End If
txtNewValue1 = "000"
txtNewValue2 = "000"
Do Until rs.EOF
'This will return a value or "000" for value1
SQLString = "Old_Value1 = '" & rs!Old_Value1 & "' and Old_Value2 = '" &
rs!Old_Value2 & "'"
If IsNull(txtNewVa lue1 = DLookup("New_Va lue1", "Table2", SQLString)) Then
txtNewValue1 = "000"
Else
txtNewValue1 = DLookup("New_Va lue1", "Table2", SQLString)
End If

'This will return a value or "000" for value 2
If Not IsNull(rs!Old_V alue3) Then
If IsNull(txtNewVa lue2 = DLookup("New_Va lue2", "Table3", "Old_Value1
= '" & rs!Old_Value3 & "'")) Then
txtNewValue2 = "000"
Else
txtNewValue2 = DLookup("New_Va lue2", "Table3", "Old_Value1 = '" &
rs!Old_Value3 & "'")
End If
Else
txtNewValue2 = "000"
End If

db.Execute " INSERT INTO Table4 (fld1, fld2) VALUES (" & " '" &
txtNewValue1 & "'" & ", '" & txtNewValue2 & "' );"

txtNewValue1 = "000"
txtNewValue2 = "000"
rs.MoveNext
Loop

MsgBox "Done", 48
Exit_Command0_C lick:
Exit Sub

Err_Command0_Cl ick:
MsgBox Err.Description
Resume Exit_Command0_C lick

End Sub
Sam M via AccessMonster.c om wrote:
Here's an example...

I ultimately want to return one record based on the translation rules
obtained from TABLE2/3 that go against the values coming in from TABLE1

Example Data

Table1 = (first 2 values translated and 2nd value has a 1:1 translate)
34,45,45
56,878, NULL

Table2 = (translation values)
34,45, 99
56,878, 33

Table3 = (translation values)
45, 66

Returned results/translations against table1

99, 66 (rec1)
33, 000 (rec2)
Thanks for the quick response... need to see an example of code to see how
the IF() works within SQL


Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
3523
by: Simon Harvey | last post by:
Whato chaps, I work (or am hoping to work! :) for a company that specialises in the following: - Localisation of media - including software, manuals, literature and training material. - Creating training material themselves in many langauges built to order. The main thing I'm thinking about for the company is maybe a sort of content
5
1809
by: Garmt de Vries | last post by:
I have a table listing various translations of the titles of a set of books. Each row represents a book, each column represents a language. It looks like this: +-------------------+------------------+-------------------+ | Français | English | Deutsch | +-------------------+------------------+-------------------+ | Le tour du monde | Around the world | Die Reise um die | | en 80 jours | in 80 days ...
3
1113
by: saduns | last post by:
how can i work on MSAcess with C++ ????
1
1017
by: LM | last post by:
Hello, Is it possible to get only the last row of a table (MSACESS) without have to load the complete table? Thank´s in advance. L. Mendes
3
29729
by: pratik.best | last post by:
Hi, I just seen the web site of the unicode committee and was amazed to see the site showing document in Hindi without using any such fonts like "Kruti Dev" or "Dev Lys". "Webdunia.com" is also showing documents in Hindi without the need to download any specific font. How's that done? Also, can I build such a page?
3
7868
by: cnucnucnu | last post by:
Hi, i'm facing one problem from 3 days.i'm unable to connect to MSAcess using ADODC control in VB please reply as soon as possible.
1
1490
by: JOHN C DEVONSHIRE | last post by:
I am creating a new form(s) in MsAcess while it is open by more then one users I have no trouble '------------------------------------------------------------ ' Module : Create_the_Employee_Tables_and_Forms ' DateTime : 10/02/2007 ' Author : John C Devonshire ' Purpose : Create the Employee Tables and Forms '------------------------------------------------------------ Sub Create_the_Employee_Tables_and_Forms()
3
1305
by: riyap | last post by:
Can anyone help me ... i want to create a console application to create a batch process to run everyday. i want to filter records from msacess database table if their status field== A, and call the package and get the id from package for every record i.e filtered Please let me how i need to create it Thanks in advance riya
44
584
by: John Dann | last post by:
I'm unclear as to how best to use what I'm terming the top-level CSS selectors, by which I mean selectors like *, html and body. I'm coming at this from trying to understand how best to set font sizes but I seem to have strayed into a broader question. Some CSS guides seem to suggest that a * declaration is good practice for any style sheet, primarily I suppose to set zero defaults for margin and padding for all other relevant selectors...
0
9688
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9546
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10268
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10247
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7571
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5593
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.