OnCurrent Issue

G

Guest

Hi,

I have an Access 97 database. On one of my forms I have 2 fields that
display calculations from queries and a list box that displays records from
another query. The sub routine below is called when a user clicks navigation
command buttons, edits or saves the form so the controls are refreshed and
display current data. This works fine. However I want to call the sub when a
user changes from one record to another (when the users use the mouse wheel
to scroll). I called the code in the OnCurrent event (see below) of the form
but I get a memory error. Is there a better place to call this? I'm
guessing Access can't determine the current record during the OnCurrent
event. Thanks for your assistance. LeAnn

**********************
Public Sub RecordCnt(ByVal lngRecord As Long)
'Description
'This code will update the record count appropriately and refresh the data

With Me
DoCmd.GoToRecord , , acLast
lngLastRecord = .CurrentRecord
DoCmd.GoToRecord , , acGoTo, lngRecord
.lblRecords.Caption = "Record " & .CurrentRecord & " of " & lngLastRecord
.lstCycles.RowSource = "SELECT CYC_ID, CycleNum, ThawDte, FreezeDte,
HrsMin, CreatedBy FROM qryCycle WHERE MSET_ID = " & Me![MSET_ID] _
& " ORDER BY CycleNum"
.lstRoomTemp.RowSource = "SELECT HrsMin FROM qryCycleSum WHERE MSET_ID =
" & ![MSET_ID]
.lstReagentTime.RowSource = "SELECT Dys FROM qryReagentTime WHERE
MSET_ID = " & ![MSET_ID]
End With

End Sub

*************************
Private Sub Form_Current()

'Get the first record
If Me.CurrentRecord <> 0 Then
Call RecordCnt(Me.CurrentRecord)
End If
End Sub
 
K

Ken Snell [MVP]

What is the exact error that you're getting (the wording and number if
available)? On which code step are you getting this error?

Current is the best event to use for what you're doing, so let's have more
info about what is happening.
 
G

Guest

It is error #2004 "There isn't enough memory to perform this operation.
Close unneeded programs and try again"

This is a new computer with a good processor and I have a gig of RAM so I
wouldn't think it is my memory.

Thanks for your input.
LeAnn


Ken Snell said:
What is the exact error that you're getting (the wording and number if
available)? On which code step are you getting this error?

Current is the best event to use for what you're doing, so let's have more
info about what is happening.

--

Ken Snell
<MS ACCESS MVP>

LeAnn said:
Hi,

I have an Access 97 database. On one of my forms I have 2 fields that
display calculations from queries and a list box that displays records
from
another query. The sub routine below is called when a user clicks
navigation
command buttons, edits or saves the form so the controls are refreshed and
display current data. This works fine. However I want to call the sub
when a
user changes from one record to another (when the users use the mouse
wheel
to scroll). I called the code in the OnCurrent event (see below) of the
form
but I get a memory error. Is there a better place to call this? I'm
guessing Access can't determine the current record during the OnCurrent
event. Thanks for your assistance. LeAnn

**********************
Public Sub RecordCnt(ByVal lngRecord As Long)
'Description
'This code will update the record count appropriately and refresh the data

With Me
DoCmd.GoToRecord , , acLast
lngLastRecord = .CurrentRecord
DoCmd.GoToRecord , , acGoTo, lngRecord
.lblRecords.Caption = "Record " & .CurrentRecord & " of " &
lngLastRecord
.lstCycles.RowSource = "SELECT CYC_ID, CycleNum, ThawDte, FreezeDte,
HrsMin, CreatedBy FROM qryCycle WHERE MSET_ID = " & Me![MSET_ID] _
& " ORDER BY CycleNum"
.lstRoomTemp.RowSource = "SELECT HrsMin FROM qryCycleSum WHERE MSET_ID
=
" & ![MSET_ID]
.lstReagentTime.RowSource = "SELECT Dys FROM qryReagentTime WHERE
MSET_ID = " & ![MSET_ID]
End With

End Sub

*************************
Private Sub Form_Current()

'Get the first record
If Me.CurrentRecord <> 0 Then
Call RecordCnt(Me.CurrentRecord)
End If
End Sub
 
K

Ken Snell [MVP]

Sounds like you've run into this Jet engine limitation with ACCESS 97
(documented in Microsoft's Knowledge Base), which occurs when you have at
least 1 GB of RAM on your PC:

ACC: "Out of Memory" Error Starting Microsoft Access
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q161255

This to be a problem with the Microsoft Jet Database Engine version 3.0 and
3.5. This problem no longer occurs in Microsoft Jet Database Engine version
3.51, which is available from Microsoft Download Center:

Updated version of Microsoft Jet 3.5 available for download
http://support.microsoft.com/kb/172733/EN-US/

Note that you need to have Microsoft Jet version 3.51.0623 or later
installed on your computer in order to install the Jet 3.5 service pack
successfully. If your computer has an earlier version of Jet than this, you
must upgrade your computer to Microsoft Office 97 Service Release 2 (SR-2).
You can get information about Office 97 SR-2 and download the Office 97 SR-2
update from Tools on the Web at the following address:
http://office.microsoft.com/en-us/assistance/HA010449951033.aspx
--

Ken Snell
<MS ACCESS MVP>



LeAnn said:
It is error #2004 "There isn't enough memory to perform this operation.
Close unneeded programs and try again"

This is a new computer with a good processor and I have a gig of RAM so I
wouldn't think it is my memory.

Thanks for your input.
LeAnn


Ken Snell said:
What is the exact error that you're getting (the wording and number if
available)? On which code step are you getting this error?

Current is the best event to use for what you're doing, so let's have
more
info about what is happening.

--

Ken Snell
<MS ACCESS MVP>

LeAnn said:
Hi,

I have an Access 97 database. On one of my forms I have 2 fields that
display calculations from queries and a list box that displays records
from
another query. The sub routine below is called when a user clicks
navigation
command buttons, edits or saves the form so the controls are refreshed
and
display current data. This works fine. However I want to call the sub
when a
user changes from one record to another (when the users use the mouse
wheel
to scroll). I called the code in the OnCurrent event (see below) of
the
form
but I get a memory error. Is there a better place to call this? I'm
guessing Access can't determine the current record during the OnCurrent
event. Thanks for your assistance. LeAnn

**********************
Public Sub RecordCnt(ByVal lngRecord As Long)
'Description
'This code will update the record count appropriately and refresh the
data

With Me
DoCmd.GoToRecord , , acLast
lngLastRecord = .CurrentRecord
DoCmd.GoToRecord , , acGoTo, lngRecord
.lblRecords.Caption = "Record " & .CurrentRecord & " of " &
lngLastRecord
.lstCycles.RowSource = "SELECT CYC_ID, CycleNum, ThawDte, FreezeDte,
HrsMin, CreatedBy FROM qryCycle WHERE MSET_ID = " & Me![MSET_ID] _
& " ORDER BY CycleNum"
.lstRoomTemp.RowSource = "SELECT HrsMin FROM qryCycleSum WHERE
MSET_ID
=
" & ![MSET_ID]
.lstReagentTime.RowSource = "SELECT Dys FROM qryReagentTime WHERE
MSET_ID = " & ![MSET_ID]
End With

End Sub

*************************
Private Sub Form_Current()

'Get the first record
If Me.CurrentRecord <> 0 Then
Call RecordCnt(Me.CurrentRecord)
End If
End Sub
 
G

Guest

I followed the instructions on how to determine the version of Jet that I
have. I actually have 3.51.3328.0 which is the latest service pack. I also
have Access 2003 installed on the same computer so there is an msjet40.dll in
the same system32 folder (and in the C:\I386 folder). Would this cause any
problems?

You didn't see any code issues in the OnCurrent Event procedure that might
cause a problem?

Thanks
LeAnn


Ken Snell said:
Sounds like you've run into this Jet engine limitation with ACCESS 97
(documented in Microsoft's Knowledge Base), which occurs when you have at
least 1 GB of RAM on your PC:

ACC: "Out of Memory" Error Starting Microsoft Access
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q161255

This to be a problem with the Microsoft Jet Database Engine version 3.0 and
3.5. This problem no longer occurs in Microsoft Jet Database Engine version
3.51, which is available from Microsoft Download Center:

Updated version of Microsoft Jet 3.5 available for download
http://support.microsoft.com/kb/172733/EN-US/

Note that you need to have Microsoft Jet version 3.51.0623 or later
installed on your computer in order to install the Jet 3.5 service pack
successfully. If your computer has an earlier version of Jet than this, you
must upgrade your computer to Microsoft Office 97 Service Release 2 (SR-2).
You can get information about Office 97 SR-2 and download the Office 97 SR-2
update from Tools on the Web at the following address:
http://office.microsoft.com/en-us/assistance/HA010449951033.aspx
--

Ken Snell
<MS ACCESS MVP>



LeAnn said:
It is error #2004 "There isn't enough memory to perform this operation.
Close unneeded programs and try again"

This is a new computer with a good processor and I have a gig of RAM so I
wouldn't think it is my memory.

Thanks for your input.
LeAnn


Ken Snell said:
What is the exact error that you're getting (the wording and number if
available)? On which code step are you getting this error?

Current is the best event to use for what you're doing, so let's have
more
info about what is happening.

--

Ken Snell
<MS ACCESS MVP>

Hi,

I have an Access 97 database. On one of my forms I have 2 fields that
display calculations from queries and a list box that displays records
from
another query. The sub routine below is called when a user clicks
navigation
command buttons, edits or saves the form so the controls are refreshed
and
display current data. This works fine. However I want to call the sub
when a
user changes from one record to another (when the users use the mouse
wheel
to scroll). I called the code in the OnCurrent event (see below) of
the
form
but I get a memory error. Is there a better place to call this? I'm
guessing Access can't determine the current record during the OnCurrent
event. Thanks for your assistance. LeAnn

**********************
Public Sub RecordCnt(ByVal lngRecord As Long)
'Description
'This code will update the record count appropriately and refresh the
data

With Me
DoCmd.GoToRecord , , acLast
lngLastRecord = .CurrentRecord
DoCmd.GoToRecord , , acGoTo, lngRecord
.lblRecords.Caption = "Record " & .CurrentRecord & " of " &
lngLastRecord
.lstCycles.RowSource = "SELECT CYC_ID, CycleNum, ThawDte, FreezeDte,
HrsMin, CreatedBy FROM qryCycle WHERE MSET_ID = " & Me![MSET_ID] _
& " ORDER BY CycleNum"
.lstRoomTemp.RowSource = "SELECT HrsMin FROM qryCycleSum WHERE
MSET_ID
=
" & ![MSET_ID]
.lstReagentTime.RowSource = "SELECT Dys FROM qryReagentTime WHERE
MSET_ID = " & ![MSET_ID]
End With

End Sub

*************************
Private Sub Form_Current()

'Get the first record
If Me.CurrentRecord <> 0 Then
Call RecordCnt(Me.CurrentRecord)
End If
End Sub
 
A

Andrew Backer

I get this error sometimes, mostly when I open on of my databases and
it tries to run the startup code. Decompiling fixes my problem. Your
issue might not be the same, but it's worth a try. I belive the syntax
is :

msaccess.exe /decompile "c:\path\to\mdb"

- Andrew Backer
 
K

Ken Snell [MVP]

I didn't see anything in your code that would be expected to produce that
error. Andrew's suggestion to decompile (make a backup copy first!) is worth
doing.
--

Ken Snell
<MS ACCESS MVP>



LeAnn said:
I followed the instructions on how to determine the version of Jet that I
have. I actually have 3.51.3328.0 which is the latest service pack. I
also
have Access 2003 installed on the same computer so there is an msjet40.dll
in
the same system32 folder (and in the C:\I386 folder). Would this cause
any
problems?

You didn't see any code issues in the OnCurrent Event procedure that might
cause a problem?

Thanks
LeAnn


Ken Snell said:
Sounds like you've run into this Jet engine limitation with ACCESS 97
(documented in Microsoft's Knowledge Base), which occurs when you have at
least 1 GB of RAM on your PC:

ACC: "Out of Memory" Error Starting Microsoft Access
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q161255

This to be a problem with the Microsoft Jet Database Engine version 3.0
and
3.5. This problem no longer occurs in Microsoft Jet Database Engine
version
3.51, which is available from Microsoft Download Center:

Updated version of Microsoft Jet 3.5 available for download
http://support.microsoft.com/kb/172733/EN-US/

Note that you need to have Microsoft Jet version 3.51.0623 or later
installed on your computer in order to install the Jet 3.5 service pack
successfully. If your computer has an earlier version of Jet than this,
you
must upgrade your computer to Microsoft Office 97 Service Release 2
(SR-2).
You can get information about Office 97 SR-2 and download the Office 97
SR-2
update from Tools on the Web at the following address:
http://office.microsoft.com/en-us/assistance/HA010449951033.aspx
--

Ken Snell
<MS ACCESS MVP>



LeAnn said:
It is error #2004 "There isn't enough memory to perform this operation.
Close unneeded programs and try again"

This is a new computer with a good processor and I have a gig of RAM so
I
wouldn't think it is my memory.

Thanks for your input.
LeAnn


:

What is the exact error that you're getting (the wording and number if
available)? On which code step are you getting this error?

Current is the best event to use for what you're doing, so let's have
more
info about what is happening.

--

Ken Snell
<MS ACCESS MVP>

Hi,

I have an Access 97 database. On one of my forms I have 2 fields
that
display calculations from queries and a list box that displays
records
from
another query. The sub routine below is called when a user clicks
navigation
command buttons, edits or saves the form so the controls are
refreshed
and
display current data. This works fine. However I want to call the
sub
when a
user changes from one record to another (when the users use the
mouse
wheel
to scroll). I called the code in the OnCurrent event (see below) of
the
form
but I get a memory error. Is there a better place to call this?
I'm
guessing Access can't determine the current record during the
OnCurrent
event. Thanks for your assistance. LeAnn

**********************
Public Sub RecordCnt(ByVal lngRecord As Long)
'Description
'This code will update the record count appropriately and refresh
the
data

With Me
DoCmd.GoToRecord , , acLast
lngLastRecord = .CurrentRecord
DoCmd.GoToRecord , , acGoTo, lngRecord
.lblRecords.Caption = "Record " & .CurrentRecord & " of " &
lngLastRecord
.lstCycles.RowSource = "SELECT CYC_ID, CycleNum, ThawDte,
FreezeDte,
HrsMin, CreatedBy FROM qryCycle WHERE MSET_ID = " & Me![MSET_ID] _
& " ORDER BY CycleNum"
.lstRoomTemp.RowSource = "SELECT HrsMin FROM qryCycleSum WHERE
MSET_ID
=
" & ![MSET_ID]
.lstReagentTime.RowSource = "SELECT Dys FROM qryReagentTime WHERE
MSET_ID = " & ![MSET_ID]
End With

End Sub

*************************
Private Sub Form_Current()

'Get the first record
If Me.CurrentRecord <> 0 Then
Call RecordCnt(Me.CurrentRecord)
End If
End Sub
 
G

Guest

I'll give it a try Andrew but I've never done what you are suggesting. Do I
execute this at the command prompt?

Thanks
LeAnn
 
A

Andrew Backer

Yes, at a command prompt.

This is such an issue with mine that I actually made a shortcut that
does it. You may have to specify the full path of msaccess.exe if it's
not in your $path, and it probably isn't. The location of msaccess.exe
may vary, so you might need to just search for it in explorer.

c:\program files\microsoft office\office\msaccess.exe /decompile
"c:\theproblem.mdb"

If you want to make a shortcut to do it, just rt-click->new->shortcut,
escape. Then edit the shortut and in the commandline put whatever
works when you type it at the command prompt ;) Or a batch file, if
you want.

HTH,
Andrew
 
G

Guest

Thanks for your help. Unfortunately it didn't run. After putting the full
path to the access program and to the database (C:\program files\Microsoft
Access97\Office\msaccess.exe /decompile "L:\Data Research\TEST\ART\art.mdb")
, I recieved: 'C:\program' is not recognized as an internal or external
command, operable program or batch file.

The command prompt defaults to our personal network directory (U:). Can
you change the root default? I tried CD C: but that didn't work.

LeAnn
 
K

Ken Snell [MVP]

You need " characters around the path to the ACCESS application program too:

"C:\program files\Microsoft Access97\Office\msaccess.exe" /decompile
"L:\Data Research\TEST\ART\art.mdb"
 

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