Format() Returns Error #Name?

Lister

Z Shift
Local time
Today, 16:52
Joined
Aug 24, 2003
Messages
305
Hi Guys
Have a spot of bother with a format function in a 97-db report that I am Fixing.
I was asked if I could fix some reports that have never worked, I opened them up and had a look.
The field had the following code.
Code:
=”Payment No “& [PaymentNo] &”until “& Format([PayDate],”Long Date”) 

Also (another field that returns just #Name?)

="Contract Sum = " & Format(DSum("[quantity]*[rate]","[Schedule Of Rates]","([Variation No] =  null) And ([ContractNo] =   [Contract Number]  )"),"Currency") & " (GST Exclusive)

Both these fields should return a value and the underling source data is the correct format and type.
I know that it’s the Format() that is causing the problem. I have tested and tested and it come back to format() each time, with the attached error message. :confused:

In this LINK , which looks just like the problem I am having, it says that I could be missing an ActiveX control.
If I am, could anyone tell me where I could get it and where I would have to insert it?

Thanks for any help :)
 

Attachments

  • FormatError.gif
    FormatError.gif
    5 KB · Views: 145
Make sure the the unbound controls (the ones that either have no ControlSource or who's ControlSource contains an expression (like what you posted) do not have a Name property (on the Other Tab of the property dialog) that duplicates any field in the form/report's RecordSource.
 
Well got there in the end. Thanks for your help Rich and Pat, but I couldn’t find a control that I was missing. In fact I think I was chasing a “wild goose” there. I also couldn’t find a duplicate Name property.
Bloody frustrating I can tell you. :mad:

So I coded the function in, so what ever was causing the problem can “be dammed”.

For anyone that’s interested here is the code.

Code:
Private Sub PageHeader0_Format(Cancel As Integer, FormatCount As Integer)
'=[Payment No] & " to " & Format ([Payment Date],"Long Date") The Failed Code
On Error GoTo Err_PageHeader0_Format
Dim intPayNo As Integer
Dim dtmPayDay As Date

intPayNo = Me.[Payment No]
dtmPayDay = Me.[Payment Date]

Me.PaymeDate = intPayNo & " to " & Format(dtmPayDay, "Long Date")

Exit_PageHeader0_Format:
Exit Sub

Err_PageHeader0_Format:
msgbox Err.Description
Resume Exit_PageHeader0_Format

End Sub

Thanks for your help and I hope this help someone. :D
 
Last edited:

Users who are viewing this thread

Back
Top Bottom