Hi,
I am working on building an administrative controls form for the database that I've been building. The form itself has no record source and is just an empty form consisting of four subforms. The issue that I've been running into is that when I go to open the form, Access gives me an "Enter Parameter Value" error that only started occurring when I added the two most recent subforms. I do not get the error when I go to load the subform separately from the main form. Any ideas on what could be causing this?
Enter Parameter Value Error On Form With Only Subforms
-
- StarLounger
- Posts: 94
- Joined: 14 Aug 2019, 00:12
-
- NewLounger
- Posts: 15
- Joined: 16 Aug 2022, 05:39
Re: Enter Parameter Value Error On Form With Only Subforms
You must check in the queries set as Record Source of the offending subforms that there is no reference to a control, which acts as a filter, but cannot be found in any of the open forms.
-
- 2StarLounger
- Posts: 119
- Joined: 22 Feb 2022, 09:04
Re: Enter Parameter Value Error On Form With Only Subforms
And what parameter value is it asking for?
That would be a clue?
Subforms load before mainforms.
That would be a clue?
Subforms load before mainforms.
Using Access 2007/2019.
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
Please, please use code tags when posting code snippets, click the </>icon.
Debug.Print is your lifesaver.
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
Please, please use code tags when posting code snippets, click the </>icon.
Debug.Print is your lifesaver.
-
- StarLounger
- Posts: 94
- Joined: 14 Aug 2019, 00:12
Re: Enter Parameter Value Error On Form With Only Subforms
Hi EileenStifone, I did confirm that the queries for the record sources on the offending subforms are only referencing fields on that form. Also, if that was the issue, wouldn't I also be having this issue when trying to load the subforms on their own, separate from the main form? As stated in the OP, doing that works fine, it's just when I try to load them as a subform.
Hi Gasman, on both of the subforms, it's the fields it's asking for parameter for are an autonumber and a number. Also, I did read something somewhere I think about subforms loading before the main form. Do you know if there's a way to delay loading of the subform to see if that resolves my issue?
Hi Gasman, on both of the subforms, it's the fields it's asking for parameter for are an autonumber and a number. Also, I did read something somewhere I think about subforms loading before the main form. Do you know if there's a way to delay loading of the subform to see if that resolves my issue?
-
- 2StarLounger
- Posts: 119
- Joined: 22 Feb 2022, 09:04
Re: Enter Parameter Value Error On Form With Only Subforms
You can set the subform control sourceobject in the main form load?
Alternatively, upload the db with instructions on how to recreate.
Alternatively, upload the db with instructions on how to recreate.
Using Access 2007/2019.
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
Please, please use code tags when posting code snippets, click the </>icon.
Debug.Print is your lifesaver.
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
Please, please use code tags when posting code snippets, click the </>icon.
Debug.Print is your lifesaver.
-
- StarLounger
- Posts: 94
- Joined: 14 Aug 2019, 00:12
Re: Enter Parameter Value Error On Form With Only Subforms
Ok I've tried the following with no success:
1. Removing the source object from the subform properties in design view and setting it on the on load event of the main form
2. Opening the subform to a new record on the on load event of the subform
Neither step, separate or together, worked to resolve the issue
-
- NewLounger
- Posts: 15
- Joined: 16 Aug 2022, 05:39
Re: Enter Parameter Value Error On Form With Only Subforms
If you can post the file.
-
- Administrator
- Posts: 78631
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Enter Parameter Value Error On Form With Only Subforms
Let's say the name of the subform in the navigation pane is MySubForm.
Do you refer to Forms!MySubForm!... in the record source of the form, or in the control source or row source of any of the controls on MySubForm?
That will work if you open MySubForm by itself, but not when you open the main form that contains MySubForm, because in that situation MySubForm is not part of the Forms collection. You'd have to use Forms!MainFormName!MySubForm!...
Do you refer to Forms!MySubForm!... in the record source of the form, or in the control source or row source of any of the controls on MySubForm?
That will work if you open MySubForm by itself, but not when you open the main form that contains MySubForm, because in that situation MySubForm is not part of the Forms collection. You'd have to use Forms!MainFormName!MySubForm!...
Best wishes,
Hans
Hans
-
- StarLounger
- Posts: 94
- Joined: 14 Aug 2019, 00:12
Re: Enter Parameter Value Error On Form With Only Subforms
Hi Hans, I went into the query behind the record source and sure enough there was a Forms!MySubForm!... reference in both of the offending queries. I changed the references to Forms!MainFormName!MySubForm!... and now they work! Thanks so much!! Definitely not something I would have thought about.HansV wrote: ↑06 May 2024, 09:55Let's say the name of the subform in the navigation pane is MySubForm.
Do you refer to Forms!MySubForm!... in the record source of the form, or in the control source or row source of any of the controls on MySubForm?
That will work if you open MySubForm by itself, but not when you open the main form that contains MySubForm, because in that situation MySubForm is not part of the Forms collection. You'd have to use Forms!MainFormName!MySubForm!...
-
- 2StarLounger
- Posts: 119
- Joined: 22 Feb 2022, 09:04
Re: Enter Parameter Value Error On Form With Only Subforms
Now they will not work if you open the subform on its own.
I used to use tempvars if I needed the form in both modes for any reason.
I used to use tempvars if I needed the form in both modes for any reason.
Using Access 2007/2019.
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
Please, please use code tags when posting code snippets, click the </>icon.
Debug.Print is your lifesaver.
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
Please, please use code tags when posting code snippets, click the </>icon.
Debug.Print is your lifesaver.