Full Version: Button wont update all subforms
UtterAccess Forums > Microsoft® Access > Access Forms
tflett
I have create a command button in my main form that is to clear all subforms for new data entry. The button is named "Add New Client", but when I click on it, a message appears saying 'Oblect doesn't support this property or method'. The code i used for this action is:
Private Sub Add_Client_Click()
On Error GoTo Err_Add_Client_Click
DoCmd.GoToRecord , , acNewRec
[Forms]![Client Data Entry]![Clients Information subform].Form
[Forms]![Client Data Entry]![ClientTraining subform].Form [Text27] = Null
[Forms]![Client Data Entry]![EmployeeJobs subform].Form [Text16] = Null
Exit_Add_Client_Click:
Exit Sub
Err_Add_Client_Click:
MsgBox Err.Description
Resume Exit_Add_Client_Click

End Sub
fkegley
If you want the new record added to the subform, then you will need to change this instruction:
oCmd.GoToRecord ,[Forms]![Client Data Entry]![ClientTraining subform].Form , acNewRec
so that it directs its action at the subform, that means you will need to change the instruction.
These two instructions will for sure need to be changed (unless it's a type):
[Forms]![Client Data Entry]![ClientTraining subform].Form.[Text27] = Null
[Forms]![Client Data Entry]![EmployeeJobs subform].Form.[Text16] = Null
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.