Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

huge problem/strange thing

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marco - 28 Jan 2008 17:54 GMT
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
KARL DEWEY - 28 Jan 2008 18:49 GMT
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?

Signature

KARL DEWEY
Build a little - Test a little

> Hi.
>
[quoted text clipped - 12 lines]
> Regards,
> Marco
Pat Hartman - 28 Jan 2008 18:54 GMT
Make sure that the reference syntax is correct:

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

> Hi.
>
[quoted text clipped - 14 lines]
> Regards,
> Marco
John W. Vinson - 28 Jan 2008 18:59 GMT
>Hi.
>
[quoted text clipped - 12 lines]
>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]
Marco - 28 Jan 2008 19:24 GMT
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

> >Hi.
> >
[quoted text clipped - 22 lines]
>
>              John W. Vinson [MVP]
John W. Vinson - 28 Jan 2008 19:45 GMT
>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]
Marco - 28 Jan 2008 20:21 GMT
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

> >Hi guys don't hang up.
>
[quoted text clipped - 10 lines]
>
>              John W. Vinson [MVP]
John W. Vinson - 29 Jan 2008 03:32 GMT
>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]
AccessVandal - 29 Jan 2008 06:44 GMT
It’s a bad idea to make us guess on what you’re attempting to do.

My guess is that you’re trying to use the forms and controls to create or
construct a SQL string.

String = “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 & “;”

If the above is not correct, meaning not using VBA. Are you using the
standard query grid? But it appears that you’re not using it.

>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;

Signature

Please Rate the posting if helps you

Larry Linson - 28 Jan 2008 19:52 GMT
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

> Hi guys don't hang up.
>
[quoted text clipped - 54 lines]
>>
>>              John W. Vinson [MVP]
Marco - 28 Jan 2008 23:55 GMT
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

> I trust that the Form is Open, Bound, and on a Record with the values you
> want to use.
[quoted text clipped - 60 lines]
> >>
> >>              John W. Vinson [MVP]
Larry Linson - 29 Jan 2008 03:46 GMT
> 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.
Marco - 29 Jan 2008 09:32 GMT
Please take a look in this example.

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

(NO VIRUS)

HELP ME.

>  > I don't know what you want to mean with Bound. But the form is connected
> to
[quoted text clipped - 46 lines]
> 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.
AccessVandal - 29 Jan 2008 10:33 GMT
Hi Marco,

You'll need to rename the table in the Field called "name" and also the
control for the form also called "name". These are reserved names in Access.
This is one of the main problems of using reserved names. For me, renaming
these took awhile. It took sometime for Access to recognized the changes when
you rename them so that the query can work.

>Please take a look in this example.
>
[quoted text clipped - 3 lines]
>
>HELP ME.

Signature

Please Rate the posting if helps you

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.