473,406 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

public recordset

I have form code that declares a public recordset at the top:

Public pubRS As DAO.Recordset

I open a recordset and assign it:

Set pubRS = rsSelect

(printing current record from pubRS works here)

I then call a public subroutine in a module and attempt to print the
current record:

Debug.Print "123---" & pubRS("TG_CNTRCT_ID")

and I get:

" Compile Error: Sub or Function not defined. "

What did I do wrong?

Thanks,

Christian

Aug 13 '07 #1
1 2900
ok, I passed the recordset in as a parameter.

I'm doing something a little non-standard:

varReplaceWith = Eval(snpReplaceCodes!ReplaceWith)

I do an Eval from a recordet where:

snpReplaceCodes!ReplaceWith = passedRS!FieldName

so in effect:

varReplaceWith = Eval(passedRS!FieldName)

Stepping through the code, as soon as it hits the eval on that
recordset, it returns from the subroutine (prematurely).

I usually use this code with forms, so in effect:

varReplaceWith = Eval(Forms!FormName!FieldName)

consistently works.

Why won't this work on a recordset without being tied to a form?
Christian

Aug 13 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Tom | last post by:
I want to open a recordset object on an .asp page. When I open the recordset I would like to use a stored procedure that expects a parameter to be passed for the stored procedure. I will then use...
8
by: WindAndWaves | last post by:
Hi everyone Why do you use the word public in a function, when the function is fully accessible without the word public in front of it. I read the help, but did not really get it. Cheers ...
36
by: kjvt | last post by:
Based on a prior posting, I've written a function to convert a recordset to a dataview. The first call to the function for a given recordset works perfectly, but the second call always returns a...
12
by: jimfortune | last post by:
I have a question based somewhat on: http://groups.google.com/group/comp.databases.ms-access/browse_frm/thread/ddde992b84f762bd/152bbc027bf00720?hl=en#152bbc027bf00720 A local table works well...
11
by: sirsnorklingtayo | last post by:
What is the Difference between Global and Public, Dim and Private variables? in Visual Basic 6.0. Because I am always using Public and Dim but using Global and Private is doing the same thing, is...
6
by: mramsay | last post by:
Hi, I am lost when it comes to creating a click event in asp. I have hyperlinks that are pulled dynamically from a table. An example is Hockey is a hyperlink. What I want to do is when a...
6
by: Oko | last post by:
I'm currently developing an MS Access Data Project (.adp) in MS Access 2002. One of the reports within the DB uses data that is Dynamic and cannot be stored on the SQL Server. To resolve this, I...
7
by: SjaakBanaan | last post by:
Hey guys (m/f), I've got a problem that's been having me pulling out hairs and losing sleep quite some time now. The thing is this. I have a container form with a subform control. This control...
10
by: timber910 | last post by:
OK, I've searched all over and used the help on the VBA editor. Helped a little but I'm not getting close enough to see where I'm going wrong. I need a public variable that I will be able to use...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.