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