Subject:
What am I doing wrong?
Date:
Tue, 30 Jan 2001 10:31:17 -0500
From:
Newsgroups:
microsoft.public.access.modulesdaovba.ado
Help if you can!
I've written code in Access 2000 to suck-in a lot of text files, and put
some of the info into a table. Everything works *great* when I
step-through the code a line at a time (using the F8 key). BUT, when I
execute it a "full speeed," and then look at my data table for the
results, some fields are blank! If you have any ideas, I'd appreciate
them, as I am at the end of my wits. I've tried idling the code,
thinking that it is executing too fast, but that doesn't work either.
Here's some sample code. The purpose of the code is to look at a text
file, and output results into a table. I've cut-out a lot of code for
this posting, but hopefully I've left enough in for someone with a clue
to spot what I'm doing wrong. Again, it works well when
stepped-through, but not at full speed!
Dim dbs_survey As DAO.Database
Dim rst_survey_in As DAO.Recordset
Dim rst_survey_out As DAO.Recordset
Dim fld_field1_in As DAO.Field
Dim fld_field1_out As DAO.Field
Set dbs_survey = opendatabase("survey.mdb")
Set rst_survey_in = dbs_survey.OpenRecordset("tbl_survey_in")
Set rst_survey_out = dbs_survey.OpenRecordset("tbl_survey_out",
dbOpenDynaset)
rst_survey_in.MoveFirst
rst_survey_out.AddNew
Do While Not rst_survey_in.EOF
rst_survey_out!model = Trim(Right(rst_survey_in!field1, 13))
rst_survey_out!Serial = Trim(Right(rst_survey_in!field1,
13))
rst_survey_out!SurveyDate = Trim(Right(rst_survey_in!field1,
20))
DBEngine.Idle
DBEngine.Idle dbRefreshCache
DBEngine.Idle dbForceOSFlush
rst_survey_in.MoveNext
Loop
DBEngine.Idle
DBEngine.Idle dbRefreshCache
DBEngine.Idle dbForceOSFlush
rst_survey_out.Update
rst_survey_in.Close
rst_survey_out.Close