What have I done wrong!

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

Added a new Field to my Table, Put a text box on the form, all good, then
tried to add a text box to the Report linked the that field, But now when I
try to open the Report I get this error
Enter parameter Value and below my field BottomTaxLabel

Thanks in advance.........Bob Vance
 
Bob,

First two things to check:
- did you spell the name of the field exactly correctly when put on
the report?
- is the report based on a query, rather than directly on the table,
in which case the field will have to be included in the query?
 
Steve on my form should it be a text box or list box?
It is just for showing what I have entered into another form no more than 50
letters...Regards Bob
Should be spelt in Name or Control source window?
 
=tblCompanyInfo!BottomTaxLabel
this what happened after I tried to enter through Source Control...Regards
Bob
 
Bob,

If your field is named BottomTaxLabel, then the textbox on your report
should have its Control Source property set as BottomTaxLabel. The Name
property of the textbox can also be BottomTaxLabel, in fact that's what
I would do, but doesn't need to be. But as I mentioned before, for this
to work the BottomTaxLabel field will need to be included in the query
or table that the report is based on. This is defined in the Record
Source property of the report itself.
 
Steve I have added another field to the table "CompanyInfo" which is called
"BottomTaxLabel" I have typed GST into the CompanyInfo Form and it shows
GST in the Table of CompanyInfo
I have done what you said but still get the Parameter Value error on my
Report, Checked it with other thing on the report like Ph Numbers and email
address,s which are copied the same from CompanyInfo. Doesn't seem to be any
Qrys......I will keep trying Thanks Bob
 
Well I made a Qry to TaxBottomLabel and the entered a Listbox linked to the
qry and it worked, only way I could get it to work, Is there any way I can
Right Align my List Box on the Report?? Thanx.. Bob
 
Bob,

What is the Record Source of the Report? (look at the properties of the
report itself, and see the Record Source property).
 
Bob,

Well, if that is the Record Source of the report, then it sounds like it
must be a Query... unusual to have a query with its name starting with
rpt, but anyway... go to the Queries tab in the Database Window, and see
if you can find that query listed there. If it is, go to the Design
view of the query. I would assume that the CompanyInfo table is part of
the query. You will need to include the new field BottomTaxLabel into
the grid, which defines which fields are returned by the query. The
report can't show a textbox bound to a field which doesn't exist in its
record source. Hope that makes sense.
 
On naming the control the same as the controlsource it is bound to: Don't.
Either don't name the control at all or give it a name similar but not
identical to the controlsource.

If you're never using VBA then this may not matter, but Access is unhappy
when a code reference refers to something on a form, and that something
could be either a field or a control. Many developers prefix control names
with things like "txt", "cbo", "lbo" to indicate text box, combo box, or
list box respectively. There are many systems Choose one and stick with
it.

But in general, having a control name with the same name as its control
source will eventually bring you grief.

Think in your own mind: If I refer to Me.BottomTaxLabel, am I referring to
the field within my recordset or the control on my form? It matters. The
moment you type a character into the control, and until you save the record,
the control and the field hold different values. If you refer to
Me.txtBottomTaxLabel, there is no ambiguity.
 
Rick,

Rick said:
... but Access is unhappy
when a code reference refers to something on a form, and that something
could be either a field or a control.

I don't really think this is true.
Many developers prefix control names
with things like "txt", "cbo", "lbo" to indicate text box, combo box, or
list box respectively.

This is correct. On the other hand, many developers do not.
There are many systems Choose one and stick with it.

Yep. I do. I use this system: "always name a bound control the same as
the field it is bound to". Works for me. :-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top