Part of the code that I want to execute when a particular command button is clicked upon, is to move to the first record of the form. This is a small form in which all 14 records of the small dataset in 'continuous' mode. The number of records never changes, as they are just settings to be used elsewhere, so we toggle them in this small form.
This command button is for setting them back to their defaults which are just stored in an unseen field in the same form. Hence the 'Set to Defaults' button just runs a little UPDATE SQL that changes 'Current_State' to 'Default'.
That all works fine with one caveat, which is that whatever the last record that was changed was doesn't update unless you have since left that record. Hence in my code before running the SQL, I want to move them out of that record.
I plan to do this by sending them to the first record and then to the next record (in case they were already on the first record). It is further noted that this form is a subform and the command button resides on this subform itself, not the parent form.
So, I use:
DoCmd.GoToRecord acDataForm, "AP_Parameter_Selection!AP_Parameter_Subform_Search_Fields" , acFirst
and I've tried every combination of using/not using quotes, brackets, not specifying parent form, using "Forms!", etc. that I can think of and nothing works.
In most variations I get an error message telling that the specified form is not open. What am I doing wrong?
This command button is for setting them back to their defaults which are just stored in an unseen field in the same form. Hence the 'Set to Defaults' button just runs a little UPDATE SQL that changes 'Current_State' to 'Default'.
That all works fine with one caveat, which is that whatever the last record that was changed was doesn't update unless you have since left that record. Hence in my code before running the SQL, I want to move them out of that record.
I plan to do this by sending them to the first record and then to the next record (in case they were already on the first record). It is further noted that this form is a subform and the command button resides on this subform itself, not the parent form.
So, I use:
DoCmd.GoToRecord acDataForm, "AP_Parameter_Selection!AP_Parameter_Subform_Search_Fields" , acFirst
and I've tried every combination of using/not using quotes, brackets, not specifying parent form, using "Forms!", etc. that I can think of and nothing works.
In most variations I get an error message telling that the specified form is not open. What am I doing wrong?