dbTalk Databases Forums  

Re: A2K tables and VB: delay to update and/or refresh ?

comp.databases.ms-access comp.databases.ms-access


Discuss Re: A2K tables and VB: delay to update and/or refresh ? in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bernard André
 
Posts: n/a

Default Re: A2K tables and VB: delay to update and/or refresh ? - 07-28-2003 , 12:06 PM






Hi Peter,

The earlier .recordcount was used previously, I was trying to make sure the
record was deleted with
while recordcount > variable_set_with_recordcount_before_delete
wend

to loop until...
About the .delete, I was firstly deleting treated records. As it appeared to
be strange (recorded treated more than once, I then decided to mark the
treated record as "sent", with the .edit and .update
No change.
I have a loop, at the end of the sub that browse from first record to last
and delete those marked as "sent"

No joy either.
What is wrong ?
When I go step by step (F5) it works perfectly.


"Peter Russell" <prussell (AT) russellscott (DOT) co.uk> wrote

Quote:
Bernard André previously wrote:

What is wrong ?

Well I may be about to make a fool of myself here here but I'm baffled by
this sequence. It appears to me that this is DAO code, but if so, the
earlier .recordcount statement won't do anything.

Regards

Peter Russell


If InStr(1, okout, "OK") <> 0 Then
Comm1.OutBufferCount = 0
Data2.Recordset.Edit
So we are using DAO?

Data2.Recordset("Sent") = True
So set the 'Sent' field on the current record to true.

Data2.Recordset.Update
Now save the current record

Data2.Recordset.Delete
Now Delete the current record - that is Delete the record you have
just updated?

wait (3)
Data2.Refresh
End If





Reply With Quote
  #2  
Old   
Peter Russell
 
Posts: n/a

Default Re: A2K tables and VB: delay to update and/or refresh ? - 07-28-2003 , 01:23 PM






Well I can't see why it should work in some circumstances but not others.

In Access VBA .refresh does not remove deleted records from a recordset,
you have to use .requery. I'm not sure whether there is any difference
in VB (I suspect not).

Perhaps the problem is related to your recordset query? Can you post
that?

I know nothing about comm port manipulation but it doesn't seem relevant
to the problem you are describing.

Regards

Peter Russell

Reply With Quote
  #3  
Old   
Peter Russell
 
Posts: n/a

Default Re: A2K tables and VB: delay to update and/or refresh ? - 07-29-2003 , 04:29 AM



http://support.microsoft.com/default...b;en-us;248833

Hope this helps.

Regards

Peter Russell

Reply With Quote
  #4  
Old   
Bernard André
 
Posts: n/a

Default Re: A2K tables and VB: delay to update and/or refresh ? - 07-29-2003 , 06:04 AM



Oh yes, it does....
Thanks a lot for this, Peter.
This will avoid me going crazy.
Regards,
Bernard

"Peter Russell" <prussell (AT) russellscott (DOT) co.uk> wrote

Quote:
http://support.microsoft.com/default...b;en-us;248833

Hope this helps.

Regards

Peter Russell



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.