Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GOTORECORD not behaving as expected in subform.

Status
Not open for further replies.

bhujanga

Programmer
Oct 18, 2007
181
US
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?
 
Hi,

This forum addresses VBA other than Access.

You might try forum702 or forum705.



Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top