How I make inquiry by text box?

K

Ken Snell

That means that your TCityN textbox is bound to a field in the form's record
source. Open the form in design view, click on the TCityN control, open the
Properties box, click on Data tab, and delete what is in the control source
box.

Then you should be able to set the AllowEdits property to No and still be
able to type in the TCityN textbox.

--
Ken Snell
<MS ACCESS MVP>

samm said:
I set AllowEdits to "yes" ,
the form always open with all records, then I change the
city name in the first record in the textbox "TCityN" for
searching.
searching is ok but the problem it is save the word which
I writen for searching with old record.
____________________________________________________
-----Original Message-----
You can't have one without the other...if you want to be able to write into
the textbox, then you must set AllowEdits to True.

Two ways to get around this:
(1) (recommended) Use a separate form for entering the text that is to be
searched, and then open the second form using the first form as the source
of the query's parameter.

(2) (much more complicated) Write code that prevents any changes to data on
the form (not recommended).
--
Ken Snell
<MS ACCESS MVP>

SAMM said:
When I select "NO" for them I can't write on textbox for
searching.
___________________________________________________
-----Original Message-----
Set the form's AllowAdditions, AllowEdits, and
AllowDeletions properties all
to No (in design view of the form).

--
Ken Snell
<MS ACCESS MVP>

hi ken
my concern only for learning,

How I make the form searching only, no delete, edit and
no
entery records?


__________________________________________________________

-----Original Message-----
When you say Properties, I assume you are referring to
being able to open
the form in design view and make changes?

If yes, there is not a simple way to do this, but you
can "turn off" all the
database's toolbars and menu bars, eliminate the
ability
to use shortcut
keys, eliminate the ability to use right-click menus,
etc. but this is not
foolproof as a knowledgeable person can "turn" on the
things you "turned"
off.

What is your concern?

--
Ken Snell
<MS ACCESS MVP>

Dear friend
Searching it is ok now,
That is great for searching with any part of word,

I have more questions can I ask or post new.
How I make the Form3 and Query no one can change
Properties except me?
____________________________________________

-----Original Message-----
Change the criterion expression in the query to
this:

Like "*" & [Forms]![Form3]![TCityN] & "*"

This will make your query search for all records
that
have any part of what
you enter in the TCityN textbox.

If you just want to search for things that begin
with
what you type:

Like [Forms]![Form3]![TCityN] & "*"
--
Ken Snell
<MS ACCESS MVP>


Thank you so much, you gave me enough answers, I
appreciated to you.
Now everything is all right. And I am happy to get
instruction from you.
I am sorry my English is not so good.
Excuse me!
Now I can search by complete name, can you help me
with
this; reach by half name or letter for city name?


______________________________


-----Original Message-----
Replace

Me.Requery step

with

Me.Requery

You don't need the step text.

--
Ken Snell
<MS ACCESS MVP>

thank you so much MR Ken Snell
I reach this page and I make as you said but
when
I
click
on the button7 to open Form3 I get error
message
say:
compile error:
wrong number of arguments or invalid property
assignment.


Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Form3"
DoCmd.OpenForm stDocName, , ,
stLinkCriteria

Exit_Command6_Click:
Me.Requery step
Exit Sub

Err_Command6_Click:
MsgBox Err.Description
Resume Exit_Command6_Click

End Sub

_____________________________________

-----Original Message-----
You're trying to put the code step in the box
next
to
the
OnClick event in
the Properties window. That is not the correct
location
for it.

Clear this code step from that box. Then
click on
the
dropdown arrow and
select [Event Procedure] from the list. Then
click
on
the "..." box next to
this box. Visual Basic Editor will open for
you
and
will
show three lines:

Private Sub cmdButtonName_Click()

End Sub

where cmdButtonName will actually be the name
of
your
command button. The
cursor will be on the blank second line.

On that second line, type the Me.Requery step.

Then close VBE and save the form. It then
should
work
for
you when you click
the button when in forms view.

--
Ken Snell
<MS ACCESS MVP>

[email protected]...
When I copy and paste this expression:
Me.Requery on
the
command button's OnClick event or on the
TCityN
textbox's
then open the form and write on the textbox
TCityN
then
enter I get error message as:

(((Microsoft Access can't find the
macro 'Me.'
the macro(or its macro group) doesn't exist
or
the
macro
is new but hasn't been saved.
note that when you enter the
macrogroupname.macroname
syntax in an argument, you must specify the
name
the
macro's macro group was last saved under))).

note
I didnot create any macro

_________________________________

-----Original Message-----
To run the query, you must tell it to run.
It
doesn't
know to do that
otherwise.

I am assuming that Form3 is displaying the
results
of
the
query as its
recordsource. With this assumption, you can
put
the
following line of code
on the command button's OnClick event, or
on
the
TCityN
textbox's
AfterUpdate event:

Me.Requery

If you use the textbox's AfterUpdate event,
then
the
query will run when you
"leave" the textbox (pressing Enter,
pressing
Tab,
or
clicking into another
control) after you've entered the value.

--
Ken Snell
<MS ACCESS MVP>

[email protected]...
I used this expression: [Forms]! [Form3]!
[TCityN],
now it
open without box asking but when I write
in
the
textbox
(TCityN) then enter or tab I don't get
information.

YES I plan to call the query? Using a
command
button
on
Form3,
and I want it to run after the user
enters a
value
into
TCityN and then presses
Tab or Enter or clicks on another
control to
get
information.

________________________________________
-----Original Message-----
Form3 MUST be open when the query runs
if
you
use
the
[Forms]![Form3]![CityN] as the
criterion.

This most recent answer says that the
name
of
your
text
box is TCityN. Your
original post said it was CityN, which
is
why
I
gave
you
the example that I
did.

If indeed the textbox is TCityN, then
use
this
expression:
[Forms]![Form3]![TCityN]

How do you plan to call the query?
Using a
command
button
on Form3? Do you
want it to run after the user enters a
value
into
TCityN
and then presses
Tab or Enter or clicks on another
control?
--
Ken Snell
<MS ACCESS MVP>


message
[email protected]...
yes i tried in two way sometime open
and
sometime
close
the Form3 and it run ok by box ask me
to
enter
parameter
value ( entre city name ) or ([Forms]!
[Form3]!
[CityN])
but i don't want inquiry by open the
query,I
want
make
inquiry by writing in the text box
names "TCityN"
in
the
form.
__________________________

-----Original Message-----
Is Form3 open when the query is being
run?

--
Ken Snell
<MS ACCESS MVP>

message
[email protected]...
I tried two query first criteria
[Enter
city
name]
in "CityN" field for city name and
second
[Forms]!
[Form3]!
[CityN].but still the problem.
if you can receive the form I will
send
it
to
you
-----Original Message-----
I cannot see your setup. Describe
what
you're
using,
what
actions you take,
etc. Post the SQL statement of the
query.

--
Ken Snell
<MS ACCESS MVP>

in
message
[email protected]...
thanks
I changed it but the still the
same
problem
------
-----Original Message-----
Change the
[Enter city name]

to
[Forms]![Form3]! [CityN]

Be sure that Form3 is open when
the
query
runs.

--
Ken Snell
<MS ACCESS MVP>

"samm" <[email protected]>
wrote
in
message
[email protected]...
I have table
names "TableAreaCod"
contain
fields
as:
CountryN: for country name
CityN : for city name
CountryC: for country code
CityC : for city code
Rate : for price each
minute
Discount : for discount and
time of
discount

I have query names "Query2"
created by
previous
table "TableAreaCod" , the
criteria
in
the
CityN
field
[Enter city name]

And I have form
names "Form3" ,
record
source "Query2"

My Question
When I open query or form
always
come
box
ask
me
to
enter
the city name it is ok query
but I
like
without
ask
I
want make inquiry by writing
city
name
in
the
text
box "CityN"in the form



.



.



.



.



.



.



.



.



.



.


.
 
S

samm

When I delete control source for TCityN and select "No"
for AllowEdits, I get "#Name?" into TCityN textbox in form
view and unable to write in TCityN textbox for searching.
___________________________________________________
-----Original Message-----
That means that your TCityN textbox is bound to a field in the form's record
source. Open the form in design view, click on the TCityN control, open the
Properties box, click on Data tab, and delete what is in the control source
box.

Then you should be able to set the AllowEdits property to No and still be
able to type in the TCityN textbox.

--
Ken Snell
<MS ACCESS MVP>

samm said:
I set AllowEdits to "yes" ,
the form always open with all records, then I change the
city name in the first record in the textbox "TCityN" for
searching.
searching is ok but the problem it is save the word which
I writen for searching with old record.
____________________________________________________
-----Original Message-----
You can't have one without the other...if you want to
be
able to write into
the textbox, then you must set AllowEdits to True.

Two ways to get around this:
(1) (recommended) Use a separate form for entering the text that is to be
searched, and then open the second form using the first form as the source
of the query's parameter.

(2) (much more complicated) Write code that prevents
any
changes to data on
the form (not recommended).
--
Ken Snell
<MS ACCESS MVP>


When I select "NO" for them I can't write on textbox for
searching.
___________________________________________________
-----Original Message-----
Set the form's AllowAdditions, AllowEdits, and
AllowDeletions properties all
to No (in design view of the form).

--
Ken Snell
<MS ACCESS MVP>

hi ken
my concern only for learning,

How I make the form searching only, no delete,
edit
and
no
entery records?
__________________________________________________________
-----Original Message-----
When you say Properties, I assume you are
referring
to
being able to open
the form in design view and make changes?

If yes, there is not a simple way to do this, but you
can "turn off" all the
database's toolbars and menu bars, eliminate the
ability
to use shortcut
keys, eliminate the ability to use right-click menus,
etc. but this is not
foolproof as a knowledgeable person can "turn" on the
things you "turned"
off.

What is your concern?

--
Ken Snell
<MS ACCESS MVP>

Dear friend
Searching it is ok now,
That is great for searching with any part of word,

I have more questions can I ask or post new.
How I make the Form3 and Query no one can change
Properties except me?
____________________________________________

-----Original Message-----
Change the criterion expression in the query to
this:

Like "*" & [Forms]![Form3]![TCityN] & "*"

This will make your query search for all records
that
have any part of what
you enter in the TCityN textbox.

If you just want to search for things that begin
with
what you type:

Like [Forms]![Form3]![TCityN] & "*"
--
Ken Snell
<MS ACCESS MVP>


Thank you so much, you gave me enough
answers,
I
appreciated to you.
Now everything is all right. And I am happy
to
get
instruction from you.
I am sorry my English is not so good.
Excuse me!
Now I can search by complete name, can you help me
with
this; reach by half name or letter for city name?


______________________________


-----Original Message-----
Replace

Me.Requery step

with

Me.Requery

You don't need the step text.

--
Ken Snell
<MS ACCESS MVP>

[email protected]...
thank you so much MR Ken Snell
I reach this page and I make as you said but
when
I
click
on the button7 to open Form3 I get error
message
say:
compile error:
wrong number of arguments or invalid property
assignment.


Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Form3"
DoCmd.OpenForm stDocName, , ,
stLinkCriteria

Exit_Command6_Click:
Me.Requery step
Exit Sub

Err_Command6_Click:
MsgBox Err.Description
Resume Exit_Command6_Click

End Sub

_____________________________________

-----Original Message-----
You're trying to put the code step in
the
box
next
to
the
OnClick event in
the Properties window. That is not the correct
location
for it.

Clear this code step from that box. Then
click on
the
dropdown arrow and
select [Event Procedure] from the list. Then
click
on
the "..." box next to
this box. Visual Basic Editor will open for
you
and
will
show three lines:

Private Sub cmdButtonName_Click()

End Sub

where cmdButtonName will actually be the name
of
your
command button. The
cursor will be on the blank second line.

On that second line, type the Me.Requery step.

Then close VBE and save the form. It then
should
work
for
you when you click
the button when in forms view.

--
Ken Snell
<MS ACCESS MVP>

[email protected]...
When I copy and paste this expression:
Me.Requery on
the
command button's OnClick event or on the
TCityN
textbox's
then open the form and write on the textbox
TCityN
then
enter I get error message as:

(((Microsoft Access can't find the
macro 'Me.'
the macro(or its macro group) doesn't exist
or
the
macro
is new but hasn't been saved.
note that when you enter the
macrogroupname.macroname
syntax in an argument, you must
specify
the
name
the
macro's macro group was last saved under))).

note
I didnot create any macro

_________________________________

-----Original Message-----
To run the query, you must tell it to run.
It
doesn't
know to do that
otherwise.

I am assuming that Form3 is
displaying
the
results
of
the
query as its
recordsource. With this assumption,
you
can
put
the
following line of code
on the command button's OnClick
event,
or
on
the
TCityN
textbox's
AfterUpdate event:

Me.Requery

If you use the textbox's AfterUpdate event,
then
the
query will run when you
"leave" the textbox (pressing Enter,
pressing
Tab,
or
clicking into another
control) after you've entered the value.

--
Ken Snell
<MS ACCESS MVP>

[email protected]...
I used this expression: [Forms]! [Form3]!
[TCityN],
now it
open without box asking but when I write
in
the
textbox
(TCityN) then enter or tab I don't get
information.

YES I plan to call the query? Using a
command
button
on
Form3,
and I want it to run after the user
enters a
value
into
TCityN and then presses
Tab or Enter or clicks on another
control to
get
information.

________________________________________
-----Original Message-----
Form3 MUST be open when the query runs
if
you
use
the
[Forms]![Form3]![CityN] as the
criterion.

This most recent answer says that the
name
of
your
text
box is TCityN. Your
original post said it was CityN, which
is
why
I
gave
you
the example that I
did.

If indeed the textbox is TCityN, then
use
this
expression:
[Forms]![Form3]![TCityN]

How do you plan to call the query?
Using a
command
button
on Form3? Do you
want it to run after the user
enters
a
value
into
TCityN
and then presses
Tab or Enter or clicks on another
control?
--
Ken Snell
<MS ACCESS MVP>


message
[email protected]...
yes i tried in two way sometime open
and
sometime
close
the Form3 and it run ok by box
ask
me
to
enter
parameter
value ( entre city name ) or ([Forms]!
[Form3]!
[CityN])
but i don't want inquiry by open the
query,I
want
make
inquiry by writing in the text box
names "TCityN"
in
the
form.
__________________________

-----Original Message-----
Is Form3 open when the query is being
run?

--
Ken Snell
<MS ACCESS MVP>

"samm" <[email protected]>
wrote
in
message
[email protected]...
I tried two query first criteria
[Enter
city
name]
in "CityN" field for city
name
and
second
[Forms]!
[Form3]!
[CityN].but still the problem.
if you can receive the form I will
send
it
to
you
-----Original Message-----
I cannot see your setup. Describe
what
you're
using,
what
actions you take,
etc. Post the SQL statement
of
the
query.

--
Ken Snell
<MS ACCESS MVP>

in
message
[email protected]...
thanks
I changed it but the still the
same
problem
------
-----Original Message---- -
Change the
[Enter city name]

to
[Forms]![Form3]! [CityN]

Be sure that Form3 is
open
when
the
query
runs.

--
Ken Snell
<MS ACCESS MVP>

"samm"
wrote
in
message
$0e6adea0
[email protected]...
I have table
names "TableAreaCod"
contain
fields
as:
CountryN: for country name
CityN : for city name
CountryC: for country code
CityC : for city code
Rate : for price each
minute
Discount : for discount and
time of
discount

I have query names "Query2"
created by
previous
table "TableAreaCod" , the
criteria
in
the
CityN
field
[Enter city name]

And I have form
names "Form3" ,
record
source "Query2"

My Question
When I open query or form
always
come
box
ask
me
to
enter
the city name it is ok query
but I
like
without
ask
I
want make inquiry by writing
city
name
in
the
text
box "CityN"in the form



.



.



.



.



.



.



.



.



.



.



.


.
 
K

Ken Snell

Change the name of the textbox from TCityN to txtTCityN, then change your
query that is using this control as part of the criterion expression to also
use txtTCityN.

When you have a control on a form and a field in that form's recordsource
with the same name, and they're not bound to each other, ACCESS isn't sure
which one you mean and throws the Name error that you're seeing.
--
Ken Snell
<MS ACCESS MVP>

samm said:
When I delete control source for TCityN and select "No"
for AllowEdits, I get "#Name?" into TCityN textbox in form
view and unable to write in TCityN textbox for searching.
___________________________________________________
-----Original Message-----
That means that your TCityN textbox is bound to a field in the form's record
source. Open the form in design view, click on the TCityN control, open the
Properties box, click on Data tab, and delete what is in the control source
box.

Then you should be able to set the AllowEdits property to No and still be
able to type in the TCityN textbox.

--
Ken Snell
<MS ACCESS MVP>

samm said:
I set AllowEdits to "yes" ,
the form always open with all records, then I change the
city name in the first record in the textbox "TCityN" for
searching.
searching is ok but the problem it is save the word which
I writen for searching with old record.
____________________________________________________

-----Original Message-----
You can't have one without the other...if you want to be
able to write into
the textbox, then you must set AllowEdits to True.

Two ways to get around this:
(1) (recommended) Use a separate form for entering the
text that is to be
searched, and then open the second form using the first
form as the source
of the query's parameter.

(2) (much more complicated) Write code that prevents any
changes to data on
the form (not recommended).
--
Ken Snell
<MS ACCESS MVP>


When I select "NO" for them I can't write on textbox for
searching.
___________________________________________________
-----Original Message-----
Set the form's AllowAdditions, AllowEdits, and
AllowDeletions properties all
to No (in design view of the form).

--
Ken Snell
<MS ACCESS MVP>

hi ken
my concern only for learning,

How I make the form searching only, no delete, edit
and
no
entery records?



__________________________________________________________

-----Original Message-----
When you say Properties, I assume you are referring
to
being able to open
the form in design view and make changes?

If yes, there is not a simple way to do this, but
you
can "turn off" all the
database's toolbars and menu bars, eliminate the
ability
to use shortcut
keys, eliminate the ability to use right-click
menus,
etc. but this is not
foolproof as a knowledgeable person can "turn" on
the
things you "turned"
off.

What is your concern?

--
Ken Snell
<MS ACCESS MVP>

Dear friend
Searching it is ok now,
That is great for searching with any part of word,

I have more questions can I ask or post new.
How I make the Form3 and Query no one can change
Properties except me?
____________________________________________

-----Original Message-----
Change the criterion expression in the query to
this:

Like "*" & [Forms]![Form3]![TCityN] & "*"

This will make your query search for all records
that
have any part of what
you enter in the TCityN textbox.

If you just want to search for things that begin
with
what you type:

Like [Forms]![Form3]![TCityN] & "*"
--
Ken Snell
<MS ACCESS MVP>


Thank you so much, you gave me enough answers,
I
appreciated to you.
Now everything is all right. And I am happy to
get
instruction from you.
I am sorry my English is not so good.
Excuse me!
Now I can search by complete name, can you
help me
with
this; reach by half name or letter for city
name?


______________________________


-----Original Message-----
Replace

Me.Requery step

with

Me.Requery

You don't need the step text.

--
Ken Snell
<MS ACCESS MVP>

[email protected]...
thank you so much MR Ken Snell
I reach this page and I make as you said but
when
I
click
on the button7 to open Form3 I get error
message
say:
compile error:
wrong number of arguments or invalid
property
assignment.


Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Form3"
DoCmd.OpenForm stDocName, , ,
stLinkCriteria

Exit_Command6_Click:
Me.Requery step
Exit Sub

Err_Command6_Click:
MsgBox Err.Description
Resume Exit_Command6_Click

End Sub

_____________________________________

-----Original Message-----
You're trying to put the code step in the
box
next
to
the
OnClick event in
the Properties window. That is not the
correct
location
for it.

Clear this code step from that box. Then
click on
the
dropdown arrow and
select [Event Procedure] from the list.
Then
click
on
the "..." box next to
this box. Visual Basic Editor will open for
you
and
will
show three lines:

Private Sub cmdButtonName_Click()

End Sub

where cmdButtonName will actually be the
name
of
your
command button. The
cursor will be on the blank second line.

On that second line, type the Me.Requery
step.

Then close VBE and save the form. It then
should
work
for
you when you click
the button when in forms view.

--
Ken Snell
<MS ACCESS MVP>

[email protected]...
When I copy and paste this expression:
Me.Requery on
the
command button's OnClick event or on the
TCityN
textbox's
then open the form and write on the
textbox
TCityN
then
enter I get error message as:

(((Microsoft Access can't find the
macro 'Me.'
the macro(or its macro group) doesn't
exist
or
the
macro
is new but hasn't been saved.
note that when you enter the
macrogroupname.macroname
syntax in an argument, you must specify
the
name
the
macro's macro group was last saved
under))).

note
I didnot create any macro

_________________________________

-----Original Message-----
To run the query, you must tell it to
run.
It
doesn't
know to do that
otherwise.

I am assuming that Form3 is displaying
the
results
of
the
query as its
recordsource. With this assumption, you
can
put
the
following line of code
on the command button's OnClick event,
or
on
the
TCityN
textbox's
AfterUpdate event:

Me.Requery

If you use the textbox's AfterUpdate
event,
then
the
query will run when you
"leave" the textbox (pressing Enter,
pressing
Tab,
or
clicking into another
control) after you've entered the value.

--
Ken Snell
<MS ACCESS MVP>

message
[email protected]...
I used this expression: [Forms]!
[Form3]!
[TCityN],
now it
open without box asking but when I
write
in
the
textbox
(TCityN) then enter or tab I don't get
information.

YES I plan to call the query? Using a
command
button
on
Form3,
and I want it to run after the user
enters a
value
into
TCityN and then presses
Tab or Enter or clicks on another
control to
get
information.


________________________________________
-----Original Message-----
Form3 MUST be open when the query
runs
if
you
use
the
[Forms]![Form3]![CityN] as the
criterion.

This most recent answer says that the
name
of
your
text
box is TCityN. Your
original post said it was CityN,
which
is
why
I
gave
you
the example that I
did.

If indeed the textbox is TCityN, then
use
this
expression:
[Forms]![Form3]![TCityN]

How do you plan to call the query?
Using a
command
button
on Form3? Do you
want it to run after the user enters
a
value
into
TCityN
and then presses
Tab or Enter or clicks on another
control?
--
Ken Snell
<MS ACCESS MVP>


message
[email protected]...
yes i tried in two way sometime
open
and
sometime
close
the Form3 and it run ok by box ask
me
to
enter
parameter
value ( entre city name ) or
([Forms]!
[Form3]!
[CityN])
but i don't want inquiry by open
the
query,I
want
make
inquiry by writing in the text box
names "TCityN"
in
the
form.
__________________________

-----Original Message-----
Is Form3 open when the query is
being
run?

--
Ken Snell
<MS ACCESS MVP>

in
message
[email protected]...
I tried two query first criteria
[Enter
city
name]
in "CityN" field for city name
and
second
[Forms]!
[Form3]!
[CityN].but still the problem.
if you can receive the form I
will
send
it
to
you
-----Original Message-----
I cannot see your setup.
Describe
what
you're
using,
what
actions you take,
etc. Post the SQL statement of
the
query.

--
Ken Snell
<MS ACCESS MVP>

"samm" <[email protected]>
wrote
in
message
[email protected]...
thanks
I changed it but the still
the
same
problem
------
-----Original Message---- -
Change the
[Enter city name]

to
[Forms]![Form3]!
[CityN]

Be sure that Form3 is open
when
the
query
runs.

--
Ken Snell
<MS ACCESS MVP>

"samm"
wrote
in
message
$0e6adea0
[email protected]...
I have table
names "TableAreaCod"
contain
fields
as:
CountryN: for country name
CityN : for city
name
CountryC: for country code
CityC : for city code
Rate : for price
each
minute
Discount : for discount
and
time of
discount

I have query
names "Query2"
created by
previous
table "TableAreaCod" ,
the
criteria
in
the
CityN
field
[Enter city name]

And I have form
names "Form3" ,
record
source "Query2"

My Question
When I open query or form
always
come
box
ask
me
to
enter
the city name it is ok
query
but I
like
without
ask
I
want make inquiry by
writing
city
name
in
the
text
box "CityN"in the form



.



.



.



.



.



.



.



.



.



.



.


.
 

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

Top