Supresssing the Automatic Bracketing of an expression

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi From Oklahoma!!

I am just learning ACESSS and have came across a problem I cannot figure
out. I am using the Query Builder in Access to build an Append Query but I
want one of the fields to appened from a text-box on a open form.
Now when I go to add the exression: "wono2: forms!frm_startup2.job" to the
Field name of the query ACCESS will automatically change it to "wono2:
[forms]![frm_startup2].[job]" that does not pull the field from the form. I
also tried using the "Build" funtion in ACCESS to select the field of the
form from the tree and allow that to populate the field name but here again
ACCESS adds the brackets to the expression. By the way the "Build" function
had the expression as "Forms![frm_startup2]![job]"

I have a similar expression of "WONO: forms!frm_startup.job" in another
query and it works fine and it did not do an Automatic Bracketing of the
expression. I just cannot figure out how to supress the Automatic Bracketing
of the exressions on this query.

Any assistance would be greatly appreciated!!! and as always THANKS IN
ADVANCE!!!

Chip
 
Chip said:
Hi From Oklahoma!!

I am just learning ACESSS and have came across a problem I cannot
figure out. I am using the Query Builder in Access to build an
Append Query but I want one of the fields to appened from a text-box
on a open form.
Now when I go to add the exression: "wono2: forms!frm_startup2.job"
to the Field name of the query ACCESS will automatically change it to
"wono2: [forms]![frm_startup2].[job]" that does not pull the field
from the form. I also tried using the "Build" funtion in ACCESS to
select the field of the form from the tree and allow that to populate
the field name but here again ACCESS adds the brackets to the
expression. By the way the "Build" function had the expression as
"Forms![frm_startup2]![job]"

I have a similar expression of "WONO: forms!frm_startup.job" in
another query and it works fine and it did not do an Automatic
Bracketing of the expression. I just cannot figure out how to
supress the Automatic Bracketing of the exressions on this query.

Any assistance would be greatly appreciated!!! and as always THANKS IN
ADVANCE!!!

Chip

The automatic bracketing is not the problem. The expression
[forms]![frm_startup2].[job] needs to be...

[forms]![frm_startup2]![job]

....notice the ! between the form name and the field/control name instead of the
(dot).

While bang OR dot might work in VBA code you generally must use the bang in
queries.
 
THANKS Rick!

But I just tried the "!" and it still does not pull that data from that
form. as in:

[forms]![frm_startup2]![job]

I get no errors, just 'blank' in that field when I run that query. I am
stumped...

Any other suggestions you can think of??

THANKS AGAIN!!!
Chip



Rick Brandt said:
Chip said:
Hi From Oklahoma!!

I am just learning ACESSS and have came across a problem I cannot
figure out. I am using the Query Builder in Access to build an
Append Query but I want one of the fields to appened from a text-box
on a open form.
Now when I go to add the exression: "wono2: forms!frm_startup2.job"
to the Field name of the query ACCESS will automatically change it to
"wono2: [forms]![frm_startup2].[job]" that does not pull the field
from the form. I also tried using the "Build" funtion in ACCESS to
select the field of the form from the tree and allow that to populate
the field name but here again ACCESS adds the brackets to the
expression. By the way the "Build" function had the expression as
"Forms![frm_startup2]![job]"

I have a similar expression of "WONO: forms!frm_startup.job" in
another query and it works fine and it did not do an Automatic
Bracketing of the expression. I just cannot figure out how to
supress the Automatic Bracketing of the exressions on this query.

Any assistance would be greatly appreciated!!! and as always THANKS IN
ADVANCE!!!

Chip

The automatic bracketing is not the problem. The expression
[forms]![frm_startup2].[job] needs to be...

[forms]![frm_startup2]![job]

....notice the ! between the form name and the field/control name instead of the
(dot).

While bang OR dot might work in VBA code you generally must use the bang in
queries.
 
Chip said:
THANKS Rick!

But I just tried the "!" and it still does not pull that data from
that form. as in:

[forms]![frm_startup2]![job]

I get no errors, just 'blank' in that field when I run that query. I
am stumped...

Any other suggestions you can think of??

That suggests that [forms]![frm_startup2]![job] either...

a) is not the control you think it is or...

b) does not contain the value you think it does.

What do you get if you type the following into the immediate code window with
that form open?

?[forms]![frm_startup2]![job] <enter>

You should get returned the current value in that control.
 
Rick, it showed "null" but I closed out the form and re-opened it and it
worked the first time I put a value in the unbound textbox of the form but
then if I put in another value and run the query again it still has the
original value ai put in. The first value entered on the form seems to not
change even if the form is changed.

Any ideas? I cannot figure it out...

THANKS FOR THE HELP!!!!

Chip



Rick Brandt said:
Chip said:
THANKS Rick!

But I just tried the "!" and it still does not pull that data from
that form. as in:

[forms]![frm_startup2]![job]

I get no errors, just 'blank' in that field when I run that query. I
am stumped...

Any other suggestions you can think of??

That suggests that [forms]![frm_startup2]![job] either...

a) is not the control you think it is or...

b) does not contain the value you think it does.

What do you get if you type the following into the immediate code window with
that form open?

?[forms]![frm_startup2]![job] <enter>

You should get returned the current value in that control.
 
Chip said:
Rick, it showed "null" but I closed out the form and re-opened it and it
worked the first time I put a value in the unbound textbox of the form but
then if I put in another value and run the query again it still has the
original value ai put in. The first value entered on the form seems to not
change even if the form is changed.

Any ideas? I cannot figure it out...

THANKS FOR THE HELP!!!!

The control is not updated until it loses focus (you need to tab out of it
before running the query).
 
THANKS, THANKS THANKS!!!!

That was it!!! I learned something important today that I had no idea would
be a problem!

THANKS AGAIN!!!

Chip
 
Back
Top