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
 

Some videos you may like

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Andrew Fergus

MrExcel MVP
Joined
Sep 9, 2004
Messages
5,432
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
 

Watch MrExcel Video

Forum statistics

Threads
1,118,082
Messages
5,570,095
Members
412,311
Latest member
Mozz
Top