I have narrowed down the problem I wrote about earlier.
I have 2 queries that reference a field called CombineNamesAddresses$("CloseForm","Seller").
If I copy the current database and import these 2 queries from the current database to a copy of the current database everything works the way I want it to.
If I import the 2 queries into a new empty database and then import into the copy of the current database, both queries give me this message. Undefined function "[CombineNamesAddress[" If I remove those fields from the query, everything else works the way I want it to.
As I have imported these queries before without having this problem, I am flummoxed.
[CODE]Function CombineName(FormName$, BaseNameEx$)
'Combine the name fields on FormName$.BaseNameEx$ as definedfor
'CombineNamesAddresss
Dim TempName$
' If Not(IsNull(Forms(FormName$)(BaseNameEx$ + "Prefix"))) Then
' TempName$ = Forms(FormName$)(BaseNameEx$ +"Prefix")
' Else
TempName$ =""
' End If
If Not(IsNull(Forms(FormName$)(BaseNameEx$ + "FName"))) Then
If TempName$<> "" Then TempName$ = TempName$ + " "
TempName$ =TempName$ + Forms(FormName$)(BaseNameEx$ + "FName")
End If
' If Not(IsNull(Forms(FormName$)(BaseNameEx$ + "Initials"))) Then
' If TempName$ <> "" ThenTempName$ = TempName$ + " "
' TempName$ = TempName$ +Forms(FormName$)(BaseNameEx$ + "Initials")
' End If
If Not(IsNull(Forms(FormName$)(BaseNameEx$ + "LName"))) Then
If TempName$<> "" Then TempName$ = TempName$ + " "
TempName$ =TempName$ + Forms(FormName$)(BaseNameEx$ + "LName")
End If
'If Not(IsNull(Forms(FormName$)(BaseNameEx$ + "Suffix"))) Then
' If TempName$ <> "" ThenTempName$ = TempName$ + " "
' TempName$ = TempName$ +Forms(FormName$)(BaseNameEx$ + "Suffix")
'End If
If TempName$ ="" Then
CombineName = Null
Else
CombineName =TempName$
End If
End Function
Function CombineNamesAddresses$(FormName$, BaseName$)
'
'Combines upto 4 names and addresses with BaseName on Form$.
'Each address is combined to a single line.
'Names without an address are attached to the previous name.
'Duplicate addresses (for sequential entries) are treated asname only above.
'
'The name consists of these fields (all prefixed withBaseName$):
'Prefix FName Initials LName Suffix
'
'Likewise the address consists of:
'Add City State Zip
''Add' is converted to a single line.
Dim Name1, Name2,Name3, Name4 As Variant
Dim Addr1, Addr2,Addr3, Addr4 As Variant
Dim Full$
'Build all the names
Name1 =CombineName(FormName$, BaseName$ + "1")
Name2 =CombineName(FormName$, BaseName$ + "2")
Name3 =CombineName(FormName$, BaseName$ + "3")
Name4 =CombineName(FormName$, BaseName$ + "4")
'...and theaddresses
Addr1 =CombineAddress(FormName$, BaseName$ + "1")
Addr2 =CombineAddress(FormName$, BaseName$ + "2")
Addr3 =CombineAddress(FormName$, BaseName$ + "3")
Addr4 =CombineAddress(FormName$, BaseName$ + "4")
'Pad out blank addresses
If IsNull(Addr1)Then Addr1 = ""
If IsNull(Addr2)Then Addr2 = Addr1
If IsNull(Addr3)Then Addr3 = Addr2
If IsNull(Addr4)Then Addr4 = Addr3
'Combine names withthe same address
If Not(IsNull(Name1) Or IsNull(Name2) Or IsNull(Addr1)) Then
If (Addr2 = Addr1)Then 'Second same as first
Name1 = Name1 +" & " + Name2
Name2 = Null
End If
End If
If Not(IsNull(Name3) Or IsNull(Name4) Or IsNull(Addr3)) Then
If (Addr4 = Addr3)Then
Name3 = Name3 +" & " + Name4
Name4 = Null
End If
End If
Full$ = ""
If Not(IsNull(Name1)) Then Full$ = Name1 + ", " + Addr1
If Not(IsNull(Name2)) Then
If Full$ <>"" Then Full$ = Full$ + Chr(13) + Chr(10)
Full$ = Full$ + Name2+ ", " + Addr2
End If
If Not(IsNull(Name3)) Then
If Full$ <>"" Then Full$ = Full$ + Chr(13) + Chr(10)
Full$ = Full$ +Name3 + ", " + Addr3
End If
If Not(IsNull(Name4)) Then
If Full$ <>"" Then Full$ = Full$ + Chr(13) + Chr(10)
Full$ = Full$ +Name4 + ", " + Addr4
End If
CombineNamesAddresses$ = Full$
End Function
[/CODE]