|
-
May 19th, 2003, 04:44 PM
#1
Thread Starter
Addicted Member
Please read this everyone. (Especially you, Martin Liss)
Hi,
I think I am a very confused programmer because I can't find what's wrong here. Here's my code:
VB Code:
With RsDependents
Dim i As Byte
If .RecordCount > 0 Then
.MoveLast
While .BOF = False
If .Fields("EmpCode") = RsPersonalData.Fields("EmpCode") Then
.Delete
End If
.MovePrevious
Wend
.Update
End If
.Close
.Open
For i = 1 To mfgDependents.Rows - 1
.AddNew
.Fields("EmpCode") = RsPersonalData.Fields("EmpCode")
.Fields("Name") = StrConv(mfgDependents.TextMatrix(i, 1), vbProperCase)
.Fields("Age") = Val(mfgDependents.TextMatrix(i, 2))
.Fields("Relationship") = StrConv(mfgDependents.TextMatrix(i, 3), vbProperCase)
.Fields("Address") = StrConv(mfgDependents.TextMatrix(i, 4), vbProperCase)
.Update
Next i
End With
It's supposed to delete the contents of a table who's empcode is the same as the empcode on another table, and afterwards add the entire contents of a flexgrid to it. Heres the problem;
everytime this code runs, i get an error message "Error occured" and then vb highlights the line next to .Addnew. Can anyone help me here?
Also, does anyone know how i can add a new page to a word document using vb and afterwards, edit certain portions of it?
[vbcode]
If SymptomsPersist Then Goto VBForum
[/vbcode]
This is our world now...the world of the electron and the switch, the beauty of the baud.We make use of a service already existing without paying for what could be dirt cheep if it wasn't run by profiteering gluttons, and you call us criminals. We explore...and you call us criminals. We exist without skin color, without nationality, without religious bias...and you call us criminals. You build atomic bombs, wage wars, murder, cheat, and lie to us and try to make us believe it is for our own good, yet we're the criminals. Yes, I am a criminal. My crime is that of curiosity. My crime is that of judging people by what they say and think, not what they look like. My crime is that of outsmarting you, something that you will never forgive me for. I am a hacker and this is my manifesto.You may stop this individual, but you can't stop us all...after all, we're all alike."
+++The Mentor+++
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|