Problem 2450 addressing an external form

Posted on 2012-09-03
Medium Priority
Last Modified: 2012-09-03
I am developing a small vbs ms/access application and I need to setup field in external forms.
On a specific form I am having the 2450 error - unable to find form.
However the form is ther as well as the fields.
I am sending in the snippets as well as the databas and, below, the related code.

Can anyone help?

rivate Sub MasterTab_Change()

    ' para cair aqui é porque o utilizador então está a escolher uma págimna nova
    Dim Found As Boolean, _
        IBool As Boolean, _
        IsSearch As Boolean, _
        AllowEnter As Boolean
    Dim srcDate As Date
    Dim I As Integer, _
        Mf As Integer, _
        Ipos As Integer, _
        NumDias As Integer, _
        L As Integer, _
        AcaoAtribuicao As Integer, _
        IErro As Integer
    Dim srcStrSQL As String, _
        strTxt As String, _
        strTabName As String, _
        strUserID As String, _
        strConteudo As String, _
        strDescricao As String, _
        strNotas As String
    Dim cdiDB As DAO.Database
    Set cdiDB = CurrentDb
    strTabName = Me.MasterTab.Pages(Me.MasterTab).Name
    strUserID = Nz(Me.F00_UserID, "")
    AllowEnter = True
    IBool = InsertLog(strTabName, "Enter", "NO", "", "", 0, 0, strUserID, "")
    If strUserID = "" Then
        IBool = InsertLog(strTabName, "blocked", "NO", "", "", 0, 0, strUserID, "User Not Identified")
        IErro = MostraErro(3, "Utilizador sem Log In")
        Select Case strTabName
        Case "Tab_Home"                 '-------------------------------------------------------------------------
        Case "Tab_NovoRegistoEntrada"
            If strUserID = "" Then
                AllowEnter = False
                strConteudo = ""
                strDescricao = ""
                strNotas = ""
' CODE WITH PROBLEM ---------------------------------------
                Forms![F0302_RegistosIn_New].[F0302_CampoConteudo] = strConteudo <----
                Forms![F0302_RegistosIn_New].[F0302_CampoDescricao] = strDescricao
                Forms![F0302_RegistosIn_New].[F0302_CampoNotas] = strNotas
            End If
        Case "Tab_RegistoSaida"         '-------------------------------------------------------------------------
            If strUserID = "" Then
                AllowEnter = False
            End If
        Case "Tab_ProcuraCDI"           '-------------------------------------------------------------------------
            If strUserID = "" Then
                AllowEnter = False
                ' limpar o formulário
                IsSearch = False
                If Nz(Me.F0303_DocID, "") <> "" Then
                    IsSearch = True
                End If
                If Nz(Me.F0303_Assento, "") <> "" Then
                    IsSearch = True
                End If
                If Nz(Me.F0303_Acronimo, "") <> "" Then
                    IsSearch = True
                End If
                If Nz(Me.F0303_Expedidor, "") <> "" Then
                    IsSearch = True
                End If
                If Nz(Me.F0303_DestinatarioInterno, "") <> "" Then
                    IsSearch = True
                End If
                If Nz(Me.F0303_Referencia, "") <> "" Then
                    IsSearch = True
                End If
                If Nz(Me.F0303_Titulo, "") <> "" Then
                    IsSearch = True
                End If
                If Not IsSearch Then
                    srcStrSQL = "SELECT * FROM T03_FichaDocumento WHERE T03_DocID= 987654321"
                    cdiDB.QueryDefs("Q00_FichaTemporaria").SQL = srcStrSQL
                    Me.F0304_ListaRegistosIn.Form.RecordSource = "Q00_FichaTemporaria"
                    Set Q00_FichasSelecionadasDef = cdiDB.QueryDefs("Q00_FichaTemporaria")
                    Set Q00_FichasSelecionadasSet = Q00_FichasSelecionadasDef.OpenRecordset(dbOpenDynaset)
                End If
            End If
        Case "Tab_Gestao"                   '-------------------------------------------------------------------------
        Case Else                           '-------------------------------------------------------------------------
        End Select
    End If
End Sub

sn 1
sn 2
sn 4CDI.07.04.accdb
Question by:João serras-pereira
  • 3
  • 2
LVL 61

Expert Comment

ID: 38360647
<<  I need to setup field in external forms. >>

By 'external form', do you mean a different form within the same database, or a form that is in a separate database.

If you are trying to refer to another form in the same database, then your syntax is OK.

<< the form is ther as well as the fields.>>

However, the form needs to be open (not just present) for this syntax to work  (just verifying that the form is indeed open).
LVL 61

Expert Comment

ID: 38360680
I just noticed that you have a sample attached to your question.

Can you outline the steps we need to follow to see/recreate the issue you are having?


Open form xyz
Click button 123
... etc

Author Comment

by:João serras-pereira
ID: 38360717
glup... I really forgot THAT


here they are:

Step 1 - start  F00_Arranca

Step 2 - Login
        2.1 Click the Login button
        2.2 Identify (User ID "jlpereira" password "1234"
        2.3 Click button "Go"

Step 3
       3.1 select the tab "Registos Entrada"

the error shows....
LVL 61

Accepted Solution

mbizup earned 2000 total points
ID: 38360743
You are trying to refer to a subform on the same form, so you need the following syntax:

                Me.F0302_RegistosIn_New_SF.Form.[F0302_CampoConteudo] = strConteudo
                Me.F0302_RegistosIn_New_SF.Form.[F0302_CampoDescricao] = strDescricao
                Me.F0302_RegistosIn_New_SF.Form.[F0302_CampoNotas] = strNotas

Open in new window


Author Closing Comment

by:João serras-pereira
ID: 38361564
Thanks a lot! It is perfect (and also the additional comment that I should have the form open (it will be very ueful in the future...)

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question