473,396 Members | 2,158 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,396 software developers and data experts.

Seek problem

I'm trying to build a Indonesian-english dictionary/translator
aplication.

I have an unbound form (Form1) with two text field (text1) & (text2)
and two command button (command1) and (command2).

My aim is to type sentences in Indonesian in text1 and translate into
english into text2 trough steps as follows:
1. split the sentences in text1 and store it into tabel T_TEMP (i've
succeded with this )
2. Compare the words in T_TEMP with the table T_MyDict
3. show the result in text2

This is the code i've done so far :

command1 is link to this code:
Private Sub Command1_Click()
Dim MyRST As DAO.Recordset
Set MyDB = CurrentDb
Set MyRST = MyDB.OpenRecordset("T_TEMP", dbOpenDynaset)
Dim i As Integer
'delete temp data
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE * FROM T_TEMP"
DoCmd.SetWarnings True
'
Text1 = Text1 & " " 'add a space just in case 'its just one word
Words = Split(Text1, " ")
With MyRST
For Wordnum = 0 To UBound(Words)
.AddNew
!ID = Wordnum
!mytext = Words(Wordnum)
!txt2 = DLast("mytext", "T_TEMP", "mytext is not null") & " "
& !mytext
'use this to handle two words that have one meaning eg. "rumah
tangga" means "households" in bahasa Indonesia
!txt3 = DLast("txt2", "T_TEMP", "txt2 is not null") & " " & !
mytext
'use this to handle THREE words that have one meaning eg. "DEWAN
PERWAKILAN RAKYAT" means "PARLIAMENT" in bahasa Indonesia
.Update
Next Wordnum
End With
End Sub

command2 is link to this code:
Private Sub Command2_Click()
call translateIt
End sub

Public Function TranslateIt() As String
Dim dbs As Database, rstMydict As Recordset, rstTemp As Recordset
Dim NumRec As Long

Set dbs = CurrentDb ' Return reference to current database.

Set rstTemp = dbs.OpenRecordset("T_Temp")

Set rstMydict = dbs.OpenRecordset("T_Mydict", , dbOpenDynaset)
' Set index for SEEK
'rstTemp.Index = "primarykey"
'rstTemp.Index = "mytext"
rstMydict.MoveFirst

Do Until rstTemp.EOF = True

rstTemp.Seek "=", rstMydict!Field1 ', rstTemp!Width

If rstTemp.NoMatch Then

Else
rstTemp.Edit
rstTemp!trnsResult = rstMydict!ENGLS
rstTemp.Update
End If
rstMydict.MoveNext
NumRec = NumRec + 1

Loop
rstTemp.Close
rstMydict.Close
Set dbs = Nothing

MsgBox NumRec - 1 & " Records Processed"

End Function
If i click command2
this error apear:
Runtime error 3265
item no found in this collection
T_TEMP:
MyText
trnsResult
T_Mydict:
Field1 (Indonesian words)
ENGLS (English words)
is there any sugestion on how to solve this
TIA,
Billy

Aug 19 '07 #1
0 1381

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

Similar topics

5
by: Shu-Hsien Sheu | last post by:
Hi, Does the seek method would close the file object after using a for loop? My program looks like this: f = open('somefile', 'r') for lines in f: some operations f.seek(0)
3
by: Pernell Williams | last post by:
Hi all: I am new to Python, and this is my first post (and it won't be my last!), so HELLO EVERYONE!! I am attempting to use "xreadlines", an outer loop and an inner loop in conjunction with...
1
by: Waitman Gobble | last post by:
Hello, I am new to Python. I am having trouble with zipfile.py. On a Linux machine with python 2.4.2 I have trouble opening a zipfile. Python is complaining about the bit where it does a...
5
by: MLH | last post by:
I have a table I can open as table type recordset or a dynaset. Searching for a particular value in the table's main keyfield, which would be faster and less strain on the application......
11
by: Tiger | last post by:
We can use seek() in the FileStream class,as we know. But I found that seek() is not work correctly in StreamReader. Who can tell me how to use seek() correctly in StreamReader? thanks a lot! I...
3
by: Mark Denardo | last post by:
Does anyone have any good VB.NET example code that shows how to use the NOTIFY option using the mciSendString API and then handle the return value. The only examples I can find show the VB way...
59
by: Rico | last post by:
Hello, I have an application that I'm converting to Access 2003 and SQL Server 2005 Express. The application uses extensive use of DAO and the SEEK method on indexes. I'm having an issue when...
4
by: ataanis | last post by:
I just realized the SEEK method has the same problem, from what I understand, it sets the file pointer to the beginning of the file, and can't be changed!!! I need a way to set the streamreader to...
3
by: Jonnh | last post by:
help with use the methods recordset and seek in access because en excel with function database, i know but en access i need seek to table or form, thanks
2
by: mhearne808[insert-at-sign-here]gmail[insert-dot-he | last post by:
I'm having a problem with the File object's seek() method. Specifically, I cannot use it to seek to a location in a binary file that is greater than 2^31 (2147483648). This seems unnecessarily...
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...
0
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,...
0
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...
0
tracyyun
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.