I am in the final stages of testing a small piece of software I made, and am experiencing a Access cannot find the referenced form 'Customer Picker'
:
I've checked over my syntax for accessing the form, and there's nothing wrong with it. I've also looked for a solution to this (this issue being well documented on Stack Overflow) but nothing has worked.
This is the (partial) code I'm using:
DoCmd.OpenReport "Invoice", acViewPreview
If (Forms![Customer Picker]![Combo3].Value = "Business") Then
Reports![Invoice]![Text154] = Forms![Customer Picker]![Text8]
Else
Reports![Invoice]![Text154] = Forms![Customer Picker]![Text10] + " " + Forms![Customer Picker]![Text6]
End If
My objective is to populate a report based on the information entered in the form, and then print the report (haven't got as far as that yet).
What am I doing wrong here, and how can I fix this?
You can only reference Forms![Customer Picker]
when the form is open.
But you reported that CurrentProject.AllForms("Customer Picker").IsLoaded
returned False.
If it is included as a subform in some other form which is open, you can reference it via the name of the subform control on that other form:
Forms![Other Form]![Subform Control]![Text8]
Note that the name of the subform control may not be the same as the name of the form which it contains.