Feb 08 2022 01:26 AM
Dear,
I developed a Access 2019cdatabase (bought on December 2021) and it working fine. now I have problem with it. Returned ccess error 2450 impossible to find a subform "etc, etc, etc,". an I help me?
Regards
FB
Feb 08 2022 12:14 PM
@bertinofra Unfortunately, that's not nearly enough information to offer any suggestions. WHERE and WHEN does this error appear? Describe the situation in terms of steps you take, not the outcome or results. That way it's more likely someone will be able to figure out what problem might be present.
Feb 09 2022 07:41 AM
Feb 15 2022 05:28 AM
Feb 15 2022 06:10 AM
The error message indicates that a subform is not where the code expects to find it. Could you SHOW the code? Not just explain what it is supposed to do? Also a screenshot of the form in DESIGN view would be helpful.
Feb 15 2022 06:46 AM
Feb 15 2022 07:16 AM
@bertinofra Thank you.
From the screen shot, it appears that there are actually two different subforms, correct? The main form has the multicolored background and one control. The upper subform has records in it and the lower form has none, Correct?
It's not clear from the screenshot where the Double-Click event runs. If it's from the main form, then it looks like the highlighted line is trying to set focus to one of the two subforms, correct?
Is that where the error is raised? The error itself isn't included.....
IF so, then you have to be sure the subform control in which the subform is embedded is specified in that highlighted line, NOT the subform itself. They may or may not have the same name. It's usually better to name them differently to disambiguate.
Feb 15 2022 07:24 AM - edited Feb 18 2022 02:18 AM
Salve,
From your pictures it looks as if the subform wouldn't be in "Sottomaschera_512C" but in the main form. So the code would have to be:
Forms!Lista_Parti_IER512C!Prelievo_Parti.SetFocus
etc.
Se questo non ti aiuta e la descrizione in italiano è più facile per te, allora vai avanti. Siamo poliglotti qui.
Ciao
Karl
-------------
Access News
Access DevCon
Feb 15 2022 08:03 AM
Feb 15 2022 05:25 PM
Feb 16 2022 01:44 AM - edited Feb 18 2022 02:17 AM
Hi,
@George: As long as the question is in English I answer in English. I just offered to do it in Italian if it's easier for the poster, but certainly most readers here speak English.
1. The pictures you posted showed code in the dblclick event of the first subform with wrong references to the second subform. Have you read and tried what I suggested as solution?
2. The code you showed now doesn't make sense. It uses two times the same name for main form and sub form and it would replace 0 by Null in the same field when the record becomes the active record. --> ?
Servus
Karl
-------------
Access News
Access DevCon
Feb 16 2022 06:23 AM
Feb 18 2022 12:35 AM
Feb 18 2022 02:32 AM - edited Feb 18 2022 04:40 AM
Salve,
Non hai risposto alle mie domande e suggerito soluzioni. Ecco li ripeterò in italiano:
Le 2 sottomaschere sono situate indipendentemente l'una dall'altra nella maschera principale. Non sono annidati. Vero? Se sì:
Il codice che aveva la linea di errore gialla nella tua immagine contiene un riferimento errato alla sottomaschera. Invece di
Forms!Sottomaschera_512C!Prelievo_Parti.SetFocus
si dovrebbe leggere
Forms!Lista_Parti_IER512C!Prelievo_Parti.SetFocus
Lo stesso vale per le seguenti righe di codice.
Poi hai postato questo come codice nell'evento Current della Sottomaschera_512C:
If [Forms]![Sottomaschera_512C]![Sottomaschera_512C]![Disponibilità] = 0 Then
[Forms]![Sottomaschera_512C]![Sottomaschera_512C]![Disponibilità] = Null
End If
Questo codice è incomprensibile perché usa lo stesso nome "Sottomaschera_512C" per la maschera principale e per la sottomaschera, il che non è possibile. Anche il suo scopo non è chiaro, ma questo non dovrebbe causare un errore.
Se [Forms]![Sottomaschera_512C]![Sottomaschera_512C]![Disponibilità]
sarebbe un riferimento alla sottomaschera stessa, cioè quella in cui si trova questo codice, allora dovrebbe essere:
Forms!Lista_Parti_IER512C!Sottomaschera_512C![Disponibilità]
o più semplice
Me![Disponibilità]
Ciao
Karl
-------------
Access News
Access DevCon
Feb 18 2022 06:01 AM
Feb 18 2022 06:10 AM - edited Feb 18 2022 06:11 AM
Salve,
Beh, almeno con l'errore sei già al campo individuale invece della sottmaschera. ;)
Qui solo tu puoi sapere come si chiamano e dove si trovano i tuoi campi e a quali oggetti si riferisce il tuo codice.
Ciao
Karl
-------------
Access News
Access DevCon
Feb 20 2022 09:48 PM
Hi @bertinofra
Here is the workaround that can manually fix this Runtime Error 2450 Cannot Find The Referenced Form Error:
Thanks!