473,799 Members | 3,224 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't Get Echo To Work

I need to temporarily remove the recordset from my form while I run some
queries (have locking problems). So I turned Echo off before removing the
recordset to avoid getting #Name? in the bound controls. However, even
though I turned Echo off, I'm still getting #Name? until I reset the
recordset. Here's the code I'm using:

DoCmd.Hourglass True
Application.Ech o False
Me.RecordSource = ""
<run queries here>
<reset recordsource here>

Anything I'm doing wrong here? (I've also tried DoCmd.Echo False, even
though OLH recommends using Application.Ech o.)

Thanks,

Neil
Nov 13 '05 #1
11 5217
Instead of removing the recordset, just force a save or undo:
If Me.Dirty Then
Me.Dirty = False ' Me.Undo
End If
That should solve the locking problem.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Neil" <no****@nospam. net> wrote in message
news:cU******** *******@newsrea d1.news.pas.ear thlink.net...
I need to temporarily remove the recordset from my form while I run some
queries (have locking problems). So I turned Echo off before removing the
recordset to avoid getting #Name? in the bound controls. However, even
though I turned Echo off, I'm still getting #Name? until I reset the
recordset. Here's the code I'm using:

DoCmd.Hourglass True
Application.Ech o False
Me.RecordSource = ""
<run queries here>
<reset recordsource here>

Anything I'm doing wrong here? (I've also tried DoCmd.Echo False, even
though OLH recommends using Application.Ech o.)

Thanks,

Neil

Nov 13 '05 #2
No, it won't. I do do a save before running my queries, but to no avail.
These are SQL queries run as pass-throughs, and, for some reason, this form,
which is a form and a subform, is putting a lock on the table and not
allowing the SPs to run.

So, back to this situation, Echo is supposed to freeze screen updating, and
removing the recordset after Echo = False should not result in any updating.
And I seem to remember using it in the past this way with good results. But
can't get this to work for some reason.

Neil
"Allen Browne" <Al*********@Se eSig.Invalid> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Instead of removing the recordset, just force a save or undo:
If Me.Dirty Then
Me.Dirty = False ' Me.Undo
End If
That should solve the locking problem.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Neil" <no****@nospam. net> wrote in message
news:cU******** *******@newsrea d1.news.pas.ear thlink.net...
I need to temporarily remove the recordset from my form while I run some
queries (have locking problems). So I turned Echo off before removing the
recordset to avoid getting #Name? in the bound controls. However, even
though I turned Echo off, I'm still getting #Name? until I reset the
recordset. Here's the code I'm using:

DoCmd.Hourglass True
Application.Ech o False
Me.RecordSource = ""
<run queries here>
<reset recordsource here>

Anything I'm doing wrong here? (I've also tried DoCmd.Echo False, even
though OLH recommends using Application.Ech o.)

Thanks,

Neil


Nov 13 '05 #3
Neil wrote:
I need to temporarily remove the recordset from my form while I run some
queries (have locking problems). So I turned Echo off before removing the
recordset to avoid getting #Name? in the bound controls. However, even
though I turned Echo off, I'm still getting #Name? until I reset the
recordset. Here's the code I'm using:

DoCmd.Hourglass True
Application.Ech o False
Me.RecordSource = ""
<run queries here>
<reset recordsource here>

Anything I'm doing wrong here? (I've also tried DoCmd.Echo False, even
though OLH recommends using Application.Ech o.)

Thanks,

Neil


Echo only refers to the status bar text AFAIK.

The code (below my sig) is from a test form with a few textboxes and two
buttons (button names in _click procedures). You should be able to adapt
that to your needs, basically it saves all the controlsources of the
controls befor unbinding the form, the second button puts them all back
on again.

--
[OO=00=OO]
Option Compare Database
Option Explicit

Dim mstrRecordSourc e As String
Dim mstrCtlSrc() As String

Private Sub Form_Open(Cance l As Integer)
mstrRecordSourc e = Me.RecordSource
End Sub
Private Sub cmdUnBound_Clic k()
Dim i As Long
ReDim mstrCtlSrc(Me.C ontrols.Count)

On Error Resume Next
' cause some of these WILL error unless you
' check their type, etc, long winded
For i = 0 To Me.Controls.Cou nt - 1
mstrCtlSrc(i) = Me.Controls(i). ControlSource
Me.Controls(i). ControlSource = ""
Next
Me.RecordSource = ""

End Sub

Private Sub cmdBound_Click( )
Dim i As Long

On Error Resume Next
Me.RecordSource = mstrRecordSourc e
For i = 0 To Me.Controls.Cou nt - 1
Me.Controls(i). ControlSource = mstrCtlSrc(i)
Next
End Sub
Nov 13 '05 #4
Neil wrote:
No, it won't. I do do a save before running my queries, but to no avail.
These are SQL queries run as pass-throughs, and, for some reason, this form,
which is a form and a subform, is putting a lock on the table and not
allowing the SPs to run.


I generally find moving to a new record is sufficient, have you tried
that before anything more drastic?
--
[OO=00=OO]
Nov 13 '05 #5
Nope, that didn't work. For some reason, the form itself is putting a lock
on the whole table. Moving to the previous record didn't help. (Plus, it
seems confusing to the user that, while the queries are being run related to
the current record, that they're seeing a different record in the form, and
they might think that they clicked the button to run the queries while in
the wrong record.)

Someone else recommended setting the recordsource to a non-existent record
(ID=0), and that seems to work OK. I end up with a blank screen, but there
are no locks and no #Name?'s.

Thanks,

Neil
"Trevor Best" <no****@besty.o rg.uk> wrote in message
news:42******** **************@ news.zen.co.uk. ..
Neil wrote:
No, it won't. I do do a save before running my queries, but to no avail.
These are SQL queries run as pass-throughs, and, for some reason, this
form, which is a form and a subform, is putting a lock on the table and
not allowing the SPs to run.


I generally find moving to a new record is sufficient, have you tried that
before anything more drastic?
--
[OO=00=OO]

Nov 13 '05 #6
> Echo only refers to the status bar text AFAIK.

No, I believe it refers to the whole screen. MS Help talks about being
locked out of an app if you turn echo off, but don't turn it back on, and
recommend having a shortcut key to turn it back on in case your code exits
without doing so. So I'm pretty sure it's a whole screen thing (and my use
of it in the past agrees with that, though I haven't used it in years).

The code (below my sig) is from a test form with a few textboxes and two
buttons (button names in _click procedures). You should be able to adapt
that to your needs, basically it saves all the controlsources of the
controls befor unbinding the form, the second button puts them all back on
again.

Hmm, well that's interesting. That would certainly be the best way to go.
Thanks for taking the time to do that!

Neil
--
[OO=00=OO]
Option Compare Database
Option Explicit

Dim mstrRecordSourc e As String
Dim mstrCtlSrc() As String

Private Sub Form_Open(Cance l As Integer)
mstrRecordSourc e = Me.RecordSource
End Sub
Private Sub cmdUnBound_Clic k()
Dim i As Long
ReDim mstrCtlSrc(Me.C ontrols.Count)

On Error Resume Next
' cause some of these WILL error unless you
' check their type, etc, long winded
For i = 0 To Me.Controls.Cou nt - 1
mstrCtlSrc(i) = Me.Controls(i). ControlSource
Me.Controls(i). ControlSource = ""
Next
Me.RecordSource = ""

End Sub

Private Sub cmdBound_Click( )
Dim i As Long

On Error Resume Next
Me.RecordSource = mstrRecordSourc e
For i = 0 To Me.Controls.Cou nt - 1
Me.Controls(i). ControlSource = mstrCtlSrc(i)
Next
End Sub

Nov 13 '05 #7
Be sure that the form's Record Locking property is set to No Locks.

--

Ken Snell
<MS ACCESS MVP>

"Neil" <no****@nospam. net> wrote in message
news:3L******** *********@newsr ead2.news.pas.e arthlink.net...
Nope, that didn't work. For some reason, the form itself is putting a lock
on the whole table. Moving to the previous record didn't help. (Plus, it
seems confusing to the user that, while the queries are being run related
to the current record, that they're seeing a different record in the form,
and they might think that they clicked the button to run the queries while
in the wrong record.)

Someone else recommended setting the recordsource to a non-existent record
(ID=0), and that seems to work OK. I end up with a blank screen, but there
are no locks and no #Name?'s.

Thanks,

Neil
"Trevor Best" <no****@besty.o rg.uk> wrote in message
news:42******** **************@ news.zen.co.uk. ..
Neil wrote:
No, it won't. I do do a save before running my queries, but to no avail.
These are SQL queries run as pass-throughs, and, for some reason, this
form, which is a form and a subform, is putting a lock on the table and
not allowing the SPs to run.


I generally find moving to a new record is sufficient, have you tried
that before anything more drastic?
--
[OO=00=OO]


Nov 13 '05 #8
Neil wrote:
Echo only refers to the status bar text AFAIK.

No, I believe it refers to the whole screen. MS Help talks about being
locked out of an app if you turn echo off, but don't turn it back on, and
recommend having a shortcut key to turn it back on in case your code exits
without doing so. So I'm pretty sure it's a whole screen thing (and my use
of it in the past agrees with that, though I haven't used it in years).


In that case it's broken then :-)

--
[OO=00=OO]
Nov 13 '05 #9
It's a SQL back end, so the record locking property has no effect. But,
FWIW, it is set to no locks.

"Ken Snell [MVP]" <kt***********@ ncoomcastt.rena etl> wrote in message
news:ea******** ******@TK2MSFTN GP14.phx.gbl...
Be sure that the form's Record Locking property is set to No Locks.

--

Ken Snell
<MS ACCESS MVP>

"Neil" <no****@nospam. net> wrote in message
news:3L******** *********@newsr ead2.news.pas.e arthlink.net...
Nope, that didn't work. For some reason, the form itself is putting a
lock on the whole table. Moving to the previous record didn't help.
(Plus, it seems confusing to the user that, while the queries are being
run related to the current record, that they're seeing a different record
in the form, and they might think that they clicked the button to run the
queries while in the wrong record.)

Someone else recommended setting the recordsource to a non-existent
record (ID=0), and that seems to work OK. I end up with a blank screen,
but there are no locks and no #Name?'s.

Thanks,

Neil
"Trevor Best" <no****@besty.o rg.uk> wrote in message
news:42******** **************@ news.zen.co.uk. ..
Neil wrote:
No, it won't. I do do a save before running my queries, but to no
avail. These are SQL queries run as pass-throughs, and, for some
reason, this form, which is a form and a subform, is putting a lock on
the table and not allowing the SPs to run.

I generally find moving to a new record is sufficient, have you tried
that before anything more drastic?
--
[OO=00=OO]



Nov 13 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2657
by: The Biscuit Eater | last post by:
Greetings from a second day newbie to php. I think I have figured out a way to explode a field in a csv file (like 11-08-03) and implode it as 031108 and then compare it to the current date(ymd) to display data after the current date. What I would like to now do is use the 11 and display Nov. Can anybody help or point me in the right direction? Thanks. Bill
20
3049
by: Wilfred Johnson | last post by:
I have a little simple hit counter. It works if I replace $cnt++; with #cnt = $cnt + 1; I can't see why this doesn't work. Any ideas? if(file_exists("counter.dat")) { $f = fopen("counter.dat", "r"); $cnt = fread($f, 10); //echo "\n", "count 1 = ", $cnt, "\n"; fclose($f);
7
6600
by: deko | last post by:
I populate a drop-down list like this: echo "<select>"; foreach ( $ip_list as $var ) { echo "<option>"; echo $var; echo "</option>"; } echo "</select>";
6
15465
by: pam | last post by:
sorry for my poor english first. $notation=$rs->fields; if(!empty($notation)) echo $notation; the notation field in database is a text type, when the value is null, it will cause a mistake; i used empty function to check it, but it seems don't take effect.
11
1325
by: sk | last post by:
According to zend.com Double and single quoted strings are handled differently by PHP. Double quoted strings are interpreted while single quoted strings are treated exactly as written. For example: $foo = 2; echo "foo is $foo"; // this prints: foo is 2 echo 'foo is $foo'; // this prints: foo is $foo echo "foo is $foo\n"; // this prints: foo is 2 (with a new-line)
27
1966
by: DavidPr | last post by:
I've been working on this script all day with no luck at all. I have to successfully test both parts of this script in order to finish this project. I haven't tested the delete part yet, because I can't get the update part to work. I just can't figure out why this will not update the database. <?php include("includes/dbconnect.php"); if(!isset($cmd)) { $result = mysql_query("select * from $table order by title"); while($r =...
10
7304
by: evicailieva | last post by:
A have a php scrip where I call a JavaScript function. I don't know why, but it doesn't work. At the beginning, when I was writing the script it was working but now it's not. I don't know wхat to do. Please help me. Here is the php code: function print_rezBilet($rezBilet,$posRezBilet1){ $step=$_SESSION; $max=$_SESSION; $curr= $_SESSION+$step-1 ; if($max<$curr) $curr=$max;
11
2280
by: Twayne | last post by:
Hi, Newbie to PHP here, no C or other relevant background, so pretty niave w/r to the nuances etc. but I think this is pretty basic. XP Pro, SP2+, PHP 4.4.7, XAMPP Local Apache Server 6.something I think and running as a service, Using NoteTab Pro as an IDE (works well). If you need more, just ask. In one functioning form:
4
1855
elen
by: elen | last post by:
hi! I wish for your help! I have a form and i want to store the results to my database and show me back what i sent to database,but my php script won't work.Can somebody help me ?I'm new in php This is my html code for a form: <html> <head> <title>ΦΟΡΜΑ ΣΤΟΙΧΕΙΩΝ ΤΑΥΤΟΤΗΤΑΣ ΑΣΘΕΝΟΥΣ</title> </head> <body bgcolor='fffaaa'>
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10470
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10247
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9067
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6803
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5459
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5583
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4135
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3751
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.