473,324 Members | 2,456 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,324 software developers and data experts.

Finding Currentrecord in Subform

Hi, I'm new to thescripts.com. I'm also new to MS Access and I have been struggling with what seems to be an easy task. I have a subform that displays query results. I am wanting to be able to get the Currentrecord of the subform that is selected. For some reason, it is returning "1" everytime when I do a me.currentrecord. I think it may be retrieving this from the mainform?
I'm pretty frustrated and any help would be great!
May 9 '07 #1
3 6373
Rabbit
12,516 Expert Mod 8TB
To refer to a property on a subform use, Me.SubformControl.Form.PropertyName.
May 9 '07 #2
JConsulting
603 Expert 512MB
Hi, I'm new to thescripts.com. I'm also new to MS Access and I have been struggling with what seems to be an easy task. I have a subform that displays query results. I am wanting to be able to get the Currentrecord of the subform that is selected. For some reason, it is returning "1" everytime when I do a me.currentrecord. I think it may be retrieving this from the mainform?
I'm pretty frustrated and any help would be great!
Hi Tony,
I think the problem is one of focus. if you're trying to run code from the main form, then as soon as you leave the subform, it no longer has a current record.

Can you explain a little better what you're trying to do and from what event, and what form?
J
May 10 '07 #3
Thanks guys! You just took away a big headache! I was looking for a way to access the properties in the subform. And the ".Form" did the trick. I don't know why they didn't make it more apparant in the help. I was about to start from square one and rethink my entire database. Thanks again.
May 10 '07 #4

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

Similar topics

1
by: Larry R Harrison Jr | last post by:
I have Access 97 and a database which fills in new values in a ****subform***. It plucks the values from the main form and plugs them into EXISTING RECORDS in the subform. What I need for it to do...
2
by: ken | last post by:
I have the following code but it does not work correctly. DoCmd.GoToRecord , , acGoTo, MySubForm.Form.CurrentRecord When the code executes it does not bring me to the correct record. If...
14
by: Rational Repairs | last post by:
I am trying to create global code for navigation use in all my forms -- including subforms. I searched, and searched, but can not find how to globally reference a subform object. I need to have the...
1
by: google | last post by:
I have a form with several subforms. Users enter the data, then on the parent there is a command button that runs code to generate a .pdf document from a report based on the data they are working...
0
by: paquer | last post by:
Im trying to sort out all subform records except for the new record created via a cmd on the main form. The command creates the new record, autofills some fields, then the PK value is...
1
by: mark_aok | last post by:
Hi all, I have a form with a subform called "mySubForm" (the subform is always in datasheet view), and I have a button labeled "return item". When users click return item, it finds the record...
1
by: Savita23 | last post by:
Hi, Is there a way to programatically set the current row in a datasheet(subform) (without clicking the row)?Pls let me know.By default,the first row in the subform gets set as the current...
10
by: AdrianGawrys | last post by:
Hi guys, I recently rewrote onClick procedure for Calendar on my form (frmRota). It opens record from tblRotas where field rDate is equal the one selected on Calendar. If such a record doesnt exist...
1
by: woodey2002 | last post by:
Hi Everyone and many thanks for your time.. I am trying to begin access and a bit of VBA i am enjoying it but I have a annoying problem I just can’t get any where on. My databse mostly includes...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.