Transfering value from one form to another form.

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
Hi everyone! i thought this should be simple but cant make it work. I have 2 forms, one is calendar and the others is form called updatefr...when date is selected i want it to be transfer to 2 form.

Thanks
Code:
[/FONT]
[FONT=Courier New]DoCmd.Close
DoCmd.OpenForm "UpdateFr", acNormal[/FONT]
[FONT=Courier New]Forms![UpdateFr].[Text3].Value = Forms![mYCalendar].[Mydate].Value

 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
What form is this code on?

It looks like you are closing the form prior to updating the form.
 
Upvote 0
Pedie

psycoperl has a very good point.

If this code is in the calendar form then that form is getting closed.

Then you try and refer to it again to put the date in the other form.

Try this, it closes the form after the date has been put in the other form.
Rich (BB code):
DoCmd.OpenForm "UpdateFr", acNormal
Forms![UpdateFr].[Text3].Value = Forms![mYCalendar].[Mydate].Value
DoCmd.Close
 
Upvote 0
Thanks Norie...
Works now with small edit.

Code:
[/FONT]
[FONT=Courier New]DoCmd.OpenForm "UpdateFr", acNormal
Forms![UpdateFr].[Text3].Value = Forms![mYCalendar].[Mydate].Value
DoCmd.Close acForm, "MyCalendar"[/FONT]
[FONT=Courier New]
 
Upvote 0

Forum statistics

Threads
1,224,543
Messages
6,179,429
Members
452,914
Latest member
echoix

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