Access Macros

Dr. Chill

Board Regular
Joined
Jan 28, 2005
Messages
83
I am trying to do a macro where I save a table and give it a different name. Is there a way to either link it to a form for part of the name or prompt a message box or something to have a name typed in?
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
I don't know if you could do this using a macro.

You could do it using VBA. Why don't you convert the existing macro to VBA and post the code?
 
Upvote 0
OK I figured it out

Option Compare Database
Option Explicit

'------------------------------------------------------------
' mcr_Move_Prior_Year_ACC_Data_ALL
'
'------------------------------------------------------------
Function mcr_Move_Prior_Year_ACC_Data_ALL()
On Error GoTo mcr_Move_Prior_Year_ACC_Data_ALL_Err

DoCmd.SetWarnings False
' Copies Prior years data to another table for Balanced
DoCmd.CopyObject "", "ACC Premium Prior Year Balanced ", acTable, "ACC Premium Balanced 1-1 to 10-31"
' Copies Prior years data to another table for Bond
DoCmd.CopyObject "", "ACC Premium Prior Year Bond", acTable, "ACC Premium Bond 1-1 to 10-31"
' Copies Prior years data to another table for High Yield
DoCmd.CopyObject "", "ACC Premium Prior Year High Yield ", acTable, "ACC Premium High Yield 1-1 to 10-31"
DoCmd.SetWarnings True


mcr_Move_Prior_Year_ACC_Data_ALL_Exit:
Exit Function

mcr_Move_Prior_Year_ACC_Data_ALL_Err:
MsgBox Error$
Resume mcr_Move_Prior_Year_ACC_Data_ALL_Exit

End Function
 
Upvote 0

Forum statistics

Threads
1,221,848
Messages
6,162,419
Members
451,765
Latest member
craigvan888

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