Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 365
  • Last Modified:

#Name? appearing on various forms in Access 2007 Runtime

Greetings,
 I am having an issue with several of my database forms. The database is distributed with Access 2007 run time. When a user attempts to use the form #Name? appears in some of the fields. This does not happen on computers with full version of Access. Thanks for any help.
0
GeneralDigitalITS
Asked:
GeneralDigitalITS
  • 8
  • 3
  • 2
  • +1
1 Solution
 
mbizupCommented:
What specifically are the Control Sources of the fields that show #Name?

Access runtime is a limited capability version of Access so some things can't be fixed without using the full version of Access.

Also, what version of Access are you developing this database in?  Another possible issue could be references.  From the VBA editor on a 2007 machine:

Tools --> References

Uncheck any that are labeled as MISSING and check the correct version from the list.
0
 
GeneralDigitalITSAuthor Commented:
I am developing in Access 2007.
No Missing References.
The control source is MaterialCode, its passed through OpenArgs.
Works fine in the ADP version.
Works fine even if I make an ADE and install it on the development computer.
As soon as I put it on a computer with run time only it turns to #Name?
Capture.PNG
0
 
Jeffrey CoachmanMIS LiasonCommented:
<Works fine in the ADP version.>
So this is also an Access Data Project?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
mbizupCommented:
Can you post the code, showing how you set and pass MaterialCode to your form, and also the code where the OpenArgs are being applied.
0
 
GeneralDigitalITSAuthor Commented:
Line 19


Public Sub cmdAdd_Click()
'=============================================================
' Purpose : Adds a record
' Author  : James DeMichele, 04-25-2002
' Revised : 1 - R. Greger 08-10-2006 per SCN0019
'=============================================================
On Error GoTo HandleErr
  If UpdateData(Me) = True Then
    If CheckForOpenFormInstance("MaterialSourceAdd") > -1 Then
      MsgBox "Only one material source add form can be open at one time.", vbInformation, "Add Material Source"
      Exit Sub
    End If
    ' 1 -----------------------------------------
    If InStr(1, Nz(Me.RecordSource, ""), "ROHS", vbTextCompare) Then
      MsgBox "This material is ROHS Compliant." & vbNewLine & _
                 "Please verify that the material source being added is ROHS compliant.", vbInformation, "ROHS Compliant Material"
    End If
    ' End 1 --------------------------------------
    OpenAddFormSub "MaterialSourceAdd", Nz(Me.txtMaterialCode, "")
    Me.Requery
    'Call GenerateRecordset(Me, , UNIQUE_TABLE)
  End If
ExitHere:
  Exit Sub
HandleErr:
    Select Case Err.Number
        Case 91 ' --- Data did not exist
          Resume ExitHere
        Case 2501 ' --- Open Form action was cancelled (because user does not have permission).
            Resume ExitHere
        Case Else
            MsgBox "Error " & Err.Number & ": " & Err.Description, vbCritical, _
            "Form_MaterialSource.cmdAdd_Click"
    End Select
End Sub

Open in new window

0
 
GeneralDigitalITSAuthor Commented:
This is the form that receives the open arg

Private Sub Form_Current()
'=============================================================
' Purpose : Set up current record when adding.
' Author  : James DeMichele, 04-25-2002
' Notes   :
'=============================================================
    Dim txtComp As String
    Dim sPref As String
    Dim sPref2 As String
    Dim intRef As Integer
    
    If Not Nz(Me.OpenArgs, "") = "" Then
      If InStr(1, Me.OpenArgs, "!", vbTextCompare) <> 0 Then
        txtComp = Nz(DLookup("Company", "dbo.CompaniesFrmView", _
            "Company = '" & Nz(Me.cboCompany, "") & "'"), "")
        If txtComp = "" And bolList = True Then
            MsgBox "This Manufacturer is not in the database.", vbInformation, _
                "Not in Database"
            cboCompany_NotInList Nz(Me.cboCompany, ""), acDataErrContinue
        End If
      End If
    End If
    
    sPref = Nz(DMax("Preference", "dbo.MaterialSource", "MaterialCode = '" & _
    ReplaceTheThing(Nz(Me.txtMaterialCode, "")) & "'"), "")
    
    sPref2 = Nz(DMin("Preference", "dbo.MaterialSource", "MaterialCode = '" & _
    ReplaceTheThing(Nz(Me.txtMaterialCode, "")) & "'"), "")
    
    intRef = Nz(DLookup("Reference", "dbo.MaterialSource", "MaterialCode = '" & _
        ReplaceTheThing(Nz(Me.txtMaterialCode, "")) & "' and Reference = 1"), 0)
        
    If sPref = "" Then
        Me.cboPreference = "B"
    ElseIf sPref = "B" And sPref2 = "B" Then
        Me.cboPreference = "A"
    ElseIf sPref = "Z" Then
        Me.cboPreference = ""
    Else
      Me.cboPreference = Chr(Asc(sPref) + 1)
    End If
    
    If intRef = 0 Then
        Me.chkReference = 1
    Else
        Me.chkReference.Enabled = False
    End If
    
End Sub

Open in new window

0
 
clarkscottCommented:
Almost sounds like you've made some back-end table structure changes and did not update the runtime front-end.

Scott C
0
 
GeneralDigitalITSAuthor Commented:
Its happening on a lot of forms. Many of which have had no changes in years. We converted to 2007 runtime a few months back, but this prob just arose within the last couple of weeks.
0
 
GeneralDigitalITSAuthor Commented:
Hey I just realized that this is happening wherever the IIF function is used. for exampled the default value for the MaterialCode text box was:
=IIf(InStr(1,Nz([OpenArgs],""),"!")<>0,Left(Nz([OpenArgs],""),(InStr(1,Nz([OpenArgs],""),"!")-1)),[OpenArgs])

If I change it to just [OpenArgs] it works fine.  Any ideas on how I can fix this issue?
0
 
mbizupCommented:
Your IIF syntax looks okay.

Test this for one of your controls:

- Remove the control source from the textbox (make the property blank)
- Place this VBA in the Open Event of your form:

Me.YourTextBox = IIf(InStr(1,Nz(Me.OpenArgs,""),"!")<>0,Left(Nz(Me.OpenArgs,""),(InStr(1,Nz(Me.OpenArgs,""),"!")-1)),Me.OpenArgs)

Open in new window

0
 
GeneralDigitalITSAuthor Commented:
Gives me invalid procedure call or argument error...I'm thinking about eliminating all this junk and just setting it to OpenArgs. still doesn't help with all the other occurrences of this issue though. If there any known issues with the IIF statement and 2007 runtime?
0
 
Jeffrey CoachmanMIS LiasonCommented:
GeneralDigitalITS,

Where do we stand?

perhaps you can post a small sample db illustrating this issue?
0
 
GeneralDigitalITSAuthor Commented:
Well I basically started removing the entire openargs statement. In some case all the jargon was not needed, openargs alone does just fine. In other cases where openargs were not involved, I started formating the values of the fields on the server instead of the front end. I guess there is no definite solution right now
0
 
GeneralDigitalITSAuthor Commented:
Kind of a work around.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 8
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now