PC Review


Reply
Thread Tools Rate Thread

Multiuser Custom Counter Not Working

 
 
Darren
Guest
Posts: n/a
 
      16th Apr 2004
I'm trying to get the code from the KB article #210194 to
work. Creating a Custom Counter.
http://support.microsoft.com/default...b;en-us;210194

As far as I can tell my code and actions are identical to
the article. However when I click on the form I get an
Error: 3265 msg. This error appears to be due to an object
being referenced before it is in the library? (link -
http://support.microsoft.com/default...b;en-us;223212)

Here is my code which compiles fine:
Function Next_Custom_Counter()

On Error GoTo Next_Custom_Counter_Err

Dim rs As ADODB.Recordset
Dim NextCounter As Long

Set rs = New ADODB.Recordset

rs.Open "CounterTable", CurrentProject.Connection,
adOpenKeyset, adLockOptimistic

NextCounter = rs!NextAvailableCounter

rs!NextAvailableCounter = NextCounter + 10
NextCounter = rs!NextAvailableCounter
rs.Update

MsgBox "Next Available Counter is " & Str(NextCounter)

rs.Close

Set rs = Nothing

Next_Custom_Counter = NextCounter

Exit Function

Any suggestions?
 
Reply With Quote
 
 
 
 
John Vinson
Guest
Posts: n/a
 
      17th Apr 2004
On Thu, 15 Apr 2004 15:49:56 -0700, "Darren"
<(E-Mail Removed)> wrote:

>As far as I can tell my code and actions are identical to
>the article. However when I click on the form I get an
>Error: 3265 msg. This error appears to be due to an object
>being referenced before it is in the library? (link -
>http://support.microsoft.com/default...b;en-us;223212)


I suspect that you're using A2000 or later, which default to using the
ADO Object Model instead of the DAO object model required by this
code.

Open the VBA editor and select Tools... References. Uncheck "Microsoft
ActiveX Data Objects" unless you know you'll be using ADOX references;
scroll down and find Microsoft DAO x.xx Object Library (highest
version) and check it instead.

John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Having problem with MultiUser Counter a24t42@att.net Microsoft Access Form Coding 1 27th Feb 2007 08:39 AM
Having problem with MultiUser Counter a24t42@att.net Microsoft Access 0 20th Feb 2007 09:10 PM
working with userid in access multiuser environmnet =?Utf-8?B?a2FzdG9yYXM=?= Microsoft Access VBA Modules 1 29th Oct 2006 04:41 PM
Multiuser Custom Counter PainInMyAccess Microsoft Access Forms 0 2nd May 2006 08:38 PM
multiuser custom counter conflict paul Microsoft Access Form Coding 1 10th Feb 2004 05:11 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:12 PM.