Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 27th, 2003, 04:47 AM
Registered User
Join Date: Aug 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default VB Data Control - Reposition does not fire

I have run into a extremely nerving problem with a Data Control (the VB built-in one):

in some installations of our software the Reposition event does not fire (see code outline below). When this happens, testing CustomerData.Recordset for Nothing returns True EVEN THOUGH it has explicitly been set in the preceding line.

- Has anyone experienced a similar problem?
- Does anyone know how to fix this?
- Does anyone know of a workaround? I tried calling the event routine directly, but obviously this was in vain because CustomerData.Recordset is not set by the explicit assignment.

Private Sub cmdFind_Click()
  dim rs as DAO.Recordset
  set rs = db.OpenRecordset(....)
  ' this normally fires CustomerData_Reposition
  set CustomerData.Recordset = rs
  debug.print "rs is " & Iif(rs is nothing,"not ","") & "set."
  ' in the case where the Reposition event does not fire,
  ' the following line prints '... not set.'
  debug.print "CustomerData.Recordset is " _
     & Iif(CustomerData.Recordset is nothing,"not ","") & "set."
End Sub

Old September 5th, 2003, 10:55 AM
Ned Ned is offline
Authorized User
Join Date: Jun 2003
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts

Try to use NEW operator in the following definition

dim rs as NEW DAO.Recordset
Old September 8th, 2003, 07:32 AM
Registered User
Join Date: Aug 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

yes - but still no Reposition event

it is not the rs recordset that is Nothing, just the CustomerData.Recordset property


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can we reposition the columns o listview-VB.NET pauljoy Pro VB 6 0 January 10th, 2006 01:43 AM
DataGrid reposition sparc Classic ASP Databases 0 August 4th, 2005 06:53 AM
Fire WebForm Method from User Control bamirzada C# 0 August 21st, 2003 03:16 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.