huge problem/strange thing

M

Marco

Hi.

I have a form and I have a query that read a value from a field in that form.

There's a strange thing. The query instead of reading that value of 52 is
reading a 4.

Then I made another test and I put the query reading another field. In that
field the value is 99 but the query reads a "C".

What the hell is this?

PLEASE HELP ME.

Regards,
Marco
 
K

KARL DEWEY

Post your query SQL that is reading the fields of the form.

Where does the form get it's data? if a query then post that. If a select
statement post that.

What are the table field names and datatypes?
 
P

Pat Hartman

Make sure that the reference syntax is correct:

Forms!mainformname!controlname
or
Forms!mainformname!subformcontrolname.Form!controlname
 
M

Marco

Hi guys don't hang up.

Let me try to specify a little more the problem.

In my query I'm creating a column with a form value. Like this:
([forms]![18_form_InsereLinhasFcsts]![Text110]) AS teste

With this I can have a column with the value that is on that form field.

what I think that is happening is that instead of putting the form field
value access is inserting Ascii values/codes.


A few minutes ago I tried with another field and instead of happning a C it
was happen 4 boxes (remember in DOS when we use to press AltGr+number to make
special characters?

This is what happening here.

Regards,
Marco
 
J

John W. Vinson

Hi guys don't hang up.

Hi marco. Give us some help here.

As requested... three times now...

please open the Query in SQL view (open it in design view and select View...
SQL from the menu). Post the SQL text here.

We CANNOT see your computer. We CANNOT help you unless you show us what you
are doing. The name of the form control does nothing useful for us, unless we
can see the rest of the query.

John W. Vinson [MVP]
 
L

Larry Linson

I trust that the Form is Open, Bound, and on a Record with the values you
want to use.

Larry Linson
Microsoft Office Access MVP


Marco said:
Hi guys don't hang up.

Let me try to specify a little more the problem.

In my query I'm creating a column with a form value. Like this:
([forms]![18_form_InsereLinhasFcsts]![Text110]) AS teste

With this I can have a column with the value that is on that form field.

what I think that is happening is that instead of putting the form field
value access is inserting Ascii values/codes.


A few minutes ago I tried with another field and instead of happning a C
it
was happen 4 boxes (remember in DOS when we use to press AltGr+number to
make
special characters?

This is what happening here.

Regards,
Marco







John W. Vinson said:
Fix the error in your query, or in the form.

Since you didn't post any information here about either, I don't see how
anyone could possibly help.

Please post the SQL view of the query, some sample data from the table,
some
sample data from the form, and some information about the nature of the
data.

John W. Vinson [MVP]
 
M

Marco

Hello. here it goes:

SELECT [11_tbl_Calculos_por_Formulas_Fcsts].ID_Formula,
[11_tbl_Calculos_por_Formulas_Fcsts].Descricao,
([forms]![18_form_InsereLinhasFcsts]![Text110]) AS teste
FROM 11_tbl_Calculos_por_Formulas_Fcsts;

I don't want that as a criteria.

Sorry
 
M

Marco

Guys, I'm so dead.

I don't know what you want to mean with Bound. But the form is connected to
a table and the table as a recordset.

It's very strange because if you have a form named FormA and inside a field
named Field1 and if the field has a default value of 2 and if you run it.

Then if you'll make a query with any table or query and put this in the
column: Test:([forms]![FormA]![Field1]) your result will be 2, tha same as
the the Form Field.

My problem is that my query instead of showing me the value of 2 is showing
another thing very strange, such as wild characters or value that has nothing
to do with it.

How can someone help?

Regards,
Marco






Larry Linson said:
I trust that the Form is Open, Bound, and on a Record with the values you
want to use.

Larry Linson
Microsoft Office Access MVP


Marco said:
Hi guys don't hang up.

Let me try to specify a little more the problem.

In my query I'm creating a column with a form value. Like this:
([forms]![18_form_InsereLinhasFcsts]![Text110]) AS teste

With this I can have a column with the value that is on that form field.

what I think that is happening is that instead of putting the form field
value access is inserting Ascii values/codes.


A few minutes ago I tried with another field and instead of happning a C
it
was happen 4 boxes (remember in DOS when we use to press AltGr+number to
make
special characters?

This is what happening here.

Regards,
Marco







John W. Vinson said:
On Mon, 28 Jan 2008 09:54:05 -0800, Marco
<[email protected]>
wrote:

Hi.

I have a form and I have a query that read a value from a field in that
form.

There's a strange thing. The query instead of reading that value of 52
is
reading a 4.

Then I made another test and I put the query reading another field. In
that
field the value is 99 but the query reads a "C".

What the hell is this?

PLEASE HELP ME.

Regards,
Marco

Fix the error in your query, or in the form.

Since you didn't post any information here about either, I don't see how
anyone could possibly help.

Please post the SQL view of the query, some sample data from the table,
some
sample data from the form, and some information about the nature of the
data.

John W. Vinson [MVP]
 
J

John W. Vinson

Hello. here it goes:

SELECT [11_tbl_Calculos_por_Formulas_Fcsts].ID_Formula,
[11_tbl_Calculos_por_Formulas_Fcsts].Descricao,
([forms]![18_form_InsereLinhasFcsts]![Text110]) AS teste
FROM 11_tbl_Calculos_por_Formulas_Fcsts;

So you want to display the table fields ID_Formula and Descricao, and also
display (independently of any table value) the contents of the Form textbox
Text110? Is this query the recordsource for the form? What are the contents of
Text110?

Access may be getting confused about the datatype of the textbox, since an
unbound textbox has no defined datatype (unlike a table field). If you want
Text110 to be shown as a number try using

Val(([forms]![18_form_InsereLinhasFcsts]![Text110]) AS teste


John W. Vinson [MVP]
 
L

Larry Linson

Marco said:
I don't know what you want to mean with Bound. But the form is connected to
a table and the table as a recordset.

I don't "want" to mean something with "bound" -- what I mean has been Access
terminology since Access 1.0. That is, a bound form has a Table or Query
shown in its RecordSource property, and fields from that RecordSource are
displayed in Controls (Text Boxes, Combo Boxes, etc.) on the Form. An
unbound form does not have a Table or Query in its RecordSource property,
and you fill the Controls and update whatever you may want to update with
your own code. Except for Forms just for controlling or entering
controlling information -- Splash Screens, entering Date Ranges for Reports,
and such -- using unbound forms is not taking avantage of the power of
Access.
It's very strange because if you have a form named FormA
and inside a field named Field1 and if the field has a default
value of 2 and if you run it.

Do you mean you have a Control (it'd be useful, maybe, even to know what
kind of control it is) in which the Field, Field1, from the Form's Record
Source is displayed, and that Control has a Default Value of 2?
Then if you'll make a query with any table or query and put
this in the column: Test:([forms]![FormA]![Field1]) your
result will be 2, tha same as the the Form Field.

I don't think you answered my question... _is FormA Open when you execute
the Query_?
My problem is that my query instead of showing me the value of 2 is showing
another thing very strange, such as wild characters or value that has nothing
to do with it.

Could you explain not "how you want to accomplish it" (that is, picking up a
value from a Control on a Form) but "what you are trying to accomplish" by
doing so? I've used Access daily since 1993 and never had a need to do what
you are trying to do. I've used references to Fields on Forms in the
Criteria, but not in the Value.

Further, I cannot reproduce getting the actual value from the referenced
Control even under the circumstances you described, of using a default value
(which implies opening the Form in DataEntry mode or moving to the new
record position with the navigation buttons to get the default value in the
Control -- Default Value only applies to new records). I've used the same
name for the Control as for the Field it Displays; I've used a different
name for the Control and Field. I even tried adding. Value to the expression
you used, and I never got the value displayed in the Control on the Form.
 
M

Marco

Please take a look in this example.

http://www.esnips.com/r/hmfl/doc/a35f6aa1-6b92-45b0-ae3b-129f7dacf68d/teste

(NO VIRUS)

HELP ME.





Larry Linson said:
Marco said:
I don't know what you want to mean with Bound. But the form is connected to
a table and the table as a recordset.

I don't "want" to mean something with "bound" -- what I mean has been Access
terminology since Access 1.0. That is, a bound form has a Table or Query
shown in its RecordSource property, and fields from that RecordSource are
displayed in Controls (Text Boxes, Combo Boxes, etc.) on the Form. An
unbound form does not have a Table or Query in its RecordSource property,
and you fill the Controls and update whatever you may want to update with
your own code. Except for Forms just for controlling or entering
controlling information -- Splash Screens, entering Date Ranges for Reports,
and such -- using unbound forms is not taking avantage of the power of
Access.
It's very strange because if you have a form named FormA
and inside a field named Field1 and if the field has a default
value of 2 and if you run it.

Do you mean you have a Control (it'd be useful, maybe, even to know what
kind of control it is) in which the Field, Field1, from the Form's Record
Source is displayed, and that Control has a Default Value of 2?
Then if you'll make a query with any table or query and put
this in the column: Test:([forms]![FormA]![Field1]) your
result will be 2, tha same as the the Form Field.

I don't think you answered my question... _is FormA Open when you execute
the Query_?
My problem is that my query instead of showing me the value of 2 is showing
another thing very strange, such as wild characters or value that has nothing
to do with it.

Could you explain not "how you want to accomplish it" (that is, picking up a
value from a Control on a Form) but "what you are trying to accomplish" by
doing so? I've used Access daily since 1993 and never had a need to do what
you are trying to do. I've used references to Fields on Forms in the
Criteria, but not in the Value.

Further, I cannot reproduce getting the actual value from the referenced
Control even under the circumstances you described, of using a default value
(which implies opening the Form in DataEntry mode or moving to the new
record position with the navigation buttons to get the default value in the
Control -- Default Value only applies to new records). I've used the same
name for the Control as for the Field it Displays; I've used a different
name for the Control and Field. I even tried adding. Value to the expression
you used, and I never got the value displayed in the Control on the Form.
 
Top