Access Formula Help

VBABasix

Board Regular
Joined
Aug 15, 2005
Messages
52
I have a form that contains a sub form. When a user has completed updating the form I then have a button that is supposed to update the field data and e-mail a report. The problem is that there may by multiple values in the sub form that have to be updated. I am not sure if I should use a loop statement or an array.
Here is the code that is executed when clicking the button:
Dim strSQL As String
On Error GoTo Err_Frm_Send_Click

strSQL = "Update TD_Status SET Date = Now(), Filed = True WHERE ID = Forms.Frm_Filing.ID;"

DoCmd.SetWarnings False
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.RunSQL strSQL
DoCmd.SendObject acSendReport

Thanks
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
How about creating a query to do what you want, save the query and run the query using VBA? The query won't care if there is only 1 record or a hundred and you won't have to worry about loops and arrays.
Just a thought
Andrew
 
Upvote 0

Forum statistics

Threads
1,215,682
Messages
6,126,195
Members
449,298
Latest member
Jest

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