Loading record in new form from subform

riggsd

Board Regular
Joined
Jan 29, 2003
Messages
143
I have a form with a datasheet subform and need to allow the user to select a row in the datasheet and then click on a button to load that record into a new form.

Since the subform is a datasheet, I can't put a button on it to load the item into the new form so I need to have the button on the main form, but have been unable to get it to work.

In the macro, the form to load is frmCoreCDRL where ="[CDRL_ID]=" & [CDRL_ID]. The subform name is frmFindCDRLsbyDID. Is there a way to add the subform name into the macro to tell it to load the record in frmCoreCDRL where CDRL_ID equals the CDRL_ID on frmFindCdRLsbyDID?

Thanks in advance.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
put cursor on record
click a button on the SUBFORM to edit it
in the ******* event of the button:

docmd.openform "frmCoreCDRL",,,"[id]=" & me.ID
 
Upvote 0
I can't add the button to the subform since it is a datasheet. I tried and even though it shows on the form in design view, it does not show up when embedded in the main form.
 
Upvote 0
Yes, we can do this. But, explaining everything here is not possible.

First, how to run event procedures on datasheet? If you go through the following link you will have enough idea and required vba code to try out them:

Event Trapping Summary On Datasheet | LEARN MS-ACCESS TIPS AND TRICKS


You can double-click on a record (or use some other Event) on the datasheet to run an event procedure that can open a form with the current record on it. You can find the details of this trick on the link given below:

Synchronized Floating popup Form | LEARN MS-ACCESS TIPS AND TRICKS

Good luck.
 
Upvote 0
Thank you. I'll look as soon as I can. For some reason, the MsAccessTips.com site is not loading here at work. I've turned in a help desk ticket to figure out why.
 
Upvote 0

Forum statistics

Threads
1,221,792
Messages
6,161,997
Members
451,735
Latest member
Deasejm

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top