473,385 Members | 1,344 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,385 software developers and data experts.

Problem Calling Public Procedure

I'm an old PowerBuilder developer that is new to Access development, and I'm stumbling on getting the rownum function to work. I've added the "rownum" public function to an existing module within my application, and I've added a textbox called "rownum" to my form with the controlsource you suggested. When I run my form, I get "#Error" displayed in the rownum textbox in each row of the form. Any idea what I might be doing wrong?

Thanks,
Jeff
Jul 17 '07 #1
6 2577
NeoPa
32,556 Expert Mod 16PB
I'm splitting this question into a thread of its own. It refers back to the Row numbers and alternate colors to a Continuous Form - simple and almost works article.

MODERATOR.
Jul 17 '07 #2
NeoPa
32,556 Expert Mod 16PB
If you have defined a TextBox named [RowNum] as well as a Public Function named [RowNum], then Access will think you are trying to access the TextBox rather than the Public Function. Try a more conventional name (like [txtRowNum]) for your TextBox instead.
Jul 17 '07 #3
Unfortunately, I had tried changing the name of the textbox before, and still got the "#Error" displayed when I ran the form. Another thing I did was to put a debug breakpoint in the public "rownum" function, and it never triggered. I had copied the function declaration right out of the posting and into a module, so I'm not sure what I could've done wrong there. As a test, I created a new form from scratch, added a textbox in the detail band with the "=rownum(Forms!myform)" as Control Source, and still got the error. Any other ideas?

Thanks!

Jeff
Jul 17 '07 #4
NeoPa
32,556 Expert Mod 16PB
What's the name and type of the module that it's defined in?
For good measure, can you post the relevant parts of the code here (The function definition and any public variables / constants it uses).

... & this may seem a silly question, but is your open form called [MyForm]?
Jul 17 '07 #5
Eureka! Your "silly" question tied directly to my silly mistake of leaving "myform" in the control source of the text box. Once I specified the form correctly, and the function works and I have row numbers. I guess I still have a ways to go before I can call myself an Access developer... Thanks so much for your help!

Jeff
Jul 17 '07 #6
NeoPa
32,556 Expert Mod 16PB
No problem Jeff.
Experience is just seeing all the little mistakes so many times. It's certainly not uncommon.
I'm pleased you got it sorted anyway :)
Jul 18 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Marina | last post by:
Here is the problem. If 2 different properties on the same (or different) control are bound to the same data column, changing the Text property and calling EndCurrentEdit discards the new value. ...
4
by: Leslaw Bieniasz | last post by:
Cracow, 20.09.2004 Hello, I need to implement a library containing a hierarchy of classes together with some binary operations on objects. To fix attention, let me assume that it is a...
2
by: Kent Lewandowski | last post by:
hi all, Recently I wrote some stored procedures using java jdbc code (admittedly my first stab) and then tried to implement the same within java packages (for code reuse). I encountered...
10
by: Saso Zagoranski | last post by:
hi, this is not actually a C# problem but since this is the only newsgroup I follow I decided to post my question here (please tell me where to post this next time if you think this post...
2
by: Woody Splawn | last post by:
I am using SQL Server 2000 as the back-end. I have created a stored procedure in SQL server called usp_AddContract. This Stored procedure inserts a new contract into a contracts table. I have...
8
by: koorb | last post by:
I am starting a program from a module with the Sub main procedure and I want it to display two forms for the program's interface, but when I run the program both forms just open and then program...
3
by: Jason | last post by:
I have an ASP.NET application in which I would like to call my button click event (imgSubmitSearch_Click) on the page load if certain criteria are met. Is this possible? What is the correct...
4
by: nishi57 | last post by:
I hope I can get some help regarding this issue, which has been going on for a while. I have a desktop user who is having problem running "Stored Procedures". The DB2 Connect application works fine...
1
by: amgupta8 | last post by:
Note: This problem occurred when I updated the JDK from 1.3.1 to 1.4.1 or 1.4.2. Nothing else was changed in the code, other than updating the JDK on the database server (dbm cfg parm jdk_path) and...
4
by: raghuvendra | last post by:
Hi I have a jsp page with 4 columns: namely Category name , Category order, Input field and a submit button. All these are aligned in a row. And Each Category Name has its corresponding Category...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.