report control source #name error

john33john33

Registered User.
Local time
Today, 09:15
Joined
Jul 23, 2015
Messages
18
Table ElectricityUsage
UserID, RecordDate, Amount
AutoNum, Date, Number

I create a blank report and add two text boxes with control source =[ElectricityUsage]![RecordDate] and =[ElectricityUsage]![Amount].
Even only with the two boxes, the error appears, #name
Then I tried another method. Add two text boxes using "add existing field". Then it shows the record.

First how is the difference of two approaches?
_______________________________________________
Table ElectricityUser
UserID, UserName
AutoNum, short

While Electricity.UserID = ElectricityUsage.UserID
I add another field [Electricity]![UserName].
Then it shows #name

intended outcome:
sample_zpsf7jxarsr.jpg

thx a lot

Attached with the test database
https://www.sendspace.com/file/9c7tu3
 
Last edited:
you don't use this [Electricity]![UserName]. You only need [UserName], and if your recordsource happens to have 2 UserName fields then you would differentiate with [Electricity].[UserName] - a dot (.), not a bang(!)

Note also that both Date and Number are reserved words (they mean something specific to Access) so using them as your field or control names can and will have unexpected consequences - typical an error that does not make sense

here is a link to reserved words

https://support.office.com/en-in/ar...-symbols-e33eb3a9-8baa-4335-9f57-da237c63eabe
 

Users who are viewing this thread

Back
Top Bottom