Unwelcome "Enter parameter value" Dialogue box

Softweb

Registered User.
Local time
Yesterday, 23:20
Joined
Feb 12, 2017
Messages
18
When I load my Assess database I am being presented with an unwelcome dialogue box labelled “Enter parameter value: Forms!frmTraining!txtTrainingID”. I am aware this is a common problem caused by object naming errors, but I have checked everything, so I would really appreciate any help with this problem. I have created a query in an Access 16 database that provides the RowSource in a List control. In the criteria of a field I have [Forms]![frmTraining]![txtTrainingID], which collects all records associated with the ID in txtTrainingID for display in the List.

I have checked for typing errors and all the naming of objects. I am wondering if I have an incorrect filepath or a syntax error in the criteria code in the Query. This is the setup, I have a Form named frmClient which contains a sub form named subTraining which contains a Form named frmTraining. On frmTraining there is the textbox named txtTrainingID, which is being used in the Query’s criteria. As I said, help would be greatly appreciated. I have spent hours trying to resolve the problem.
:confused:
 
Try changing:
Code:
Forms!frmTraining!txtTrainingID
...to:
Code:
Forms!frmClient!subTraining!txtTrainingID
 
Thanks ByteMyzer. I have tried that but the problem persists. The database opens normally if I leave the parameter blank and click ok.
 

Attachments

  • Parameter error mesage.jpg
    Parameter error mesage.jpg
    15 KB · Views: 108
Is that form actually open when the parameter box appears ?
 
To reference a control on a subform the path would be...
Code:
Forms![I]<FormName>.<SubformControlName>[/I].Form.[I]<ControlName>[/I]
The name of the subform is not in that path, but if you used a wizard to put the subform on the main form, then the <SubformControlName> is likely to be the same as the subform's name.
 
Hi Minty. Thanks for the reply. No the Form is not open. When I close the Parameter box (without entering a value) the database continues to open normally.

Thanks MarkK I'll try that code.
 
Hi Minty. Thanks for the reply. No the Form is not open. When I close the Parameter box (without entering a value) the database continues to open normally.
That's your problem then - you can't use a form control value as a parameter for a query if the form isn't actually open.
 
Thanks Minty. That make some sense. So am I right in thinking the query SQL is written into the List RowSource, so it is not until the Form opens that it can run and have access to the txtTraining on the Form. Is the answer to only assign the query string to the RowSource with Form load() ?
 
Thanks Minty. That make some sense. So am I right in thinking the query SQL is written into the List RowSource, so it is not until the Form opens that it can run and have access to the txtTraining on the Form. Is the answer to only assign the query string to the RowSource with Form load() ?

Yup - and make sure its the On_Load event - not on form Open.
 
Thanks everyone for your help on this one.
 

Users who are viewing this thread

Back
Top Bottom