473,508 Members | 2,324 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Numbering records on a form

30 New Member
I have a query which returns a list of 5 records at random and have been looking for a way to number these records 1 to 5 simply as a visual aid to users. I used the following code in an unbound text box on my form: =RowNum([Forms]![MyFormName]) and everything worked. Then I used this form as a subform and now get a #Type! error. I thought it would work since the code is contained in the sub form rather than being referred to from the main form but I am clearly missing something. Any advice would be gratefully received.

Thanks
Mar 26 '13 #1
9 1395
Rabbit
12,516 Recognized Expert Moderator MVP
If it's a subform, the form itself is no longer in the forms collection. You will need to access it through the parent form to the subform to the control.
Mar 26 '13 #2
Rob Amor
30 New Member
Thanks for the reply, I am not sure how to do that. I have tried putting the following code as the control source for the unbound textbox on the subform.
=RowNum([Forms]![MainFormName]![SubformName]) but am getting the same #type error
If I add the textbox name =RowNum([Forms]![MainFormName]![SubformName].[textbox] I get a #name? error.
I appreciate that I am missing something obvious and/or doing something daft but if you could set me right I would be most grateful.
Thanks
Mar 27 '13 #3
Rabbit
12,516 Recognized Expert Moderator MVP
Do you need to fully qualify the control reference? Can you just not use the textbox name without all the form references?
Mar 27 '13 #4
Rob Amor
30 New Member
Without using [Forms]![FormName] the RowNum function doesn't work even on a straight form. I have tried various combinations to get it to work but usually when referencing a subform control I do it from the main form and I can't get my head around calling a subform control from the very subform control I am calling. Doesn't feel like it could work, but I am really not much good with VBA so my feeling really doesn't count for very much. Sorry if I am not explaining myself particularly well or if I am misunderstanding what you are saying.
Mar 27 '13 #5
Rabbit
12,516 Recognized Expert Moderator MVP
Is this RowNum a custom function? I can't find any reference to it in the Visual Basic 6 documentation.
Mar 27 '13 #6
Rob Amor
30 New Member
I actually found it on this forum in another post. It suggested using =RowNum([Forms]![MyFormName])in an unbound textbox to number records, and that's about all I know about it. Works a treat until the form becomes a sub form. Certainly if you type rownum into the control source box in the textbox properties it appears as an autocomplete option as a function. Does that shed any light?
Mar 27 '13 #7
Rabbit
12,516 Recognized Expert Moderator MVP
Still can't find a reference to it. I wonder if it's a part of a third party library. Try using the intellisense to see if there's any documentation on it.
Mar 28 '13 #8
Rob Amor
30 New Member
Had a look and I can't find anything which sheds any light on the problem. Tried searching the internet again and found nothing that helps there either. Maybe it just can't be used in a subform? Maybe time for me to look at an alternative method? Thanks for your Help Rabbit I appreciate your time and input.
Apr 2 '13 #9
Rabbit
12,516 Recognized Expert Moderator MVP
Not a problem, sorry I couldn't be of more help. If you want to try an alternate method, please create a new thread for that so that we can start fresh.
Apr 2 '13 #10

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

Similar topics

1
1898
by: Wayne Aprato | last post by:
I have a report that shows the results of a query. One of the fields is an autonumber field from the query which shows for instance: 120, 121 , 122 for 3 records. Is there a way to have another...
2
2293
by: Wayne Aprato | last post by:
I posted this yesterday and it seems like a moderator has thrown it in another thread. This is a totally different question to the one asked in that thread, so I'm posting it again. It is not a...
2
3038
by: Colm O'Hagan | last post by:
Hi there, I having a problem with a database I'm setting up, I would be delighted if someone out there could help. The database I'm setting up is a task register datebase, it will be used to...
3
2790
by: Simone | last post by:
Hi All, I have a Find Record button setup in most of my forms in order to find a specific customer's details. I have just noticed today though that this search will only find the customer if it...
20
2031
by: Prakash | last post by:
Hi ! I have a field "sub_tran_no" in my form in continuous view. When the user presses a button "Re-Number", I'd like to: 1) Save the current record pointer position 2) Save the current...
5
1640
by: MLH | last post by:
I have a form based on a table that is opened this way... DoCmd.OpenForm "frmAdminSetupInfo", , , , A_EDIT It was my intention that the form allow the user to edit table data - not add...
3
2572
by: Chris | last post by:
Before I started to create table, etc to track unique form field record number assigments I thought I'd check to see if there is now a better way to do this in .NET. I have a parent form (table)...
1
2371
by: pankajprakash | last post by:
hi, i have a webpage with to textbox named username and password and a datagrid. i have also a add button. whenever i click the add button then the contenct of both textboxes must be fill in the...
2
2445
by: nspader | last post by:
OK, I am pulling my hair out on this one. It seems like it should be so simple and I cannot seem to find the answer. I am using Access 2000 on Windows 2000. I have two tables set up. Table...
0
1555
by: Hamayun Khan | last post by:
Hi All I am using the following query to select records from two tables. Select JobTitle,JobDesc,Scraped,logoimage,JobPostID,SchoolID,web,MemType,InstitutionName,PayScale,LEA,Contract as...
0
7229
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7129
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
7333
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7398
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
7502
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...
1
5057
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...
0
1566
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
428
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.