473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Combo Box Usage Shuts Down Application

Hi,

I have a combo box on a form whose purpose is to add a record to the
form's underlying table. There are several (16) fields that the combo
box carries with it, only a few that are visible to the User. When the
User selects a value from the combo box, the application shuts down.
Here is the code for the combo box that may lead to the problem.
==============================================
Private Sub cboAddPhysician_AfterUpdate()
On Error GoTo PROC_ERR
Dim DB As Database

Dim rst1 As Recordset
Dim rst2 As Recordset

Set DB = CurrentDb
Set rst1 = DB.OpenRecordset("tblProduct_Proctoree_DFU",
dbOpenDynaset)
Set rst2 = DB.OpenRecordset("tblProduct_Proctoree_DeviceTrain ing",
dbOpenDynaset)
rst1.AddNew
rst1!LinkID = Me.cboAddPhysician.Column(0)
rst1!ProctoreeFull_LF = Me.cboAddPhysician.Column(1)
rst1!PrimaryInstitution = Me.cboAddPhysician.Column(2)
rst1!PrimInstID = Me.cboAddPhysician.Column(3)
rst1!ProctoreeFull_FL = Me.cboAddPhysician.Column(4)
rst1!PrimaryInstAddress = Me.cboAddPhysician.Column(5)
rst1!PrimaryInstCity = Me.cboAddPhysician.Column(6)
rst1!PrimaryInstState = Me.cboAddPhysician.Column(7)
rst1!PrimaryInstZip = Me.cboAddPhysician.Column(8)
rst1!ProctoreeLast = Me.cboAddPhysician.Column(9)
rst1!ProctoreeFirst = Me.cboAddPhysician.Column(10)
rst1!ProctoreeMI = Me.cboAddPhysician.Column(11)
rst1!ProctoreeSuffix = Me.cboAddPhysician.Column(12)
rst1!ProctoreeLongDegree = Me.cboAddPhysician.Column(13)
rst1!ProctoreeDFUSpecialtyID = Me.cboAddPhysician.Column(14)
rst1!ProctoreeDFUSpecialty = Me.cboAddPhysician.Column(15)
rst1!Created = Now()

rst1.Update

rst2.AddNew
rst2!LinkID = Me.cboAddPhysician.Column(0)
rst2!PrimaryInstitution = Me.cboAddPhysician.Column(2)
rst2!PrimInstID = Me.cboAddPhysician.Column(3)
rst2!ProctoreeFull_FL = Me.cboAddPhysician.Column(4)
rst2!ProctoreeLast = Me.cboAddPhysician.Column(9)
rst2!ProctoreeFirst = Me.cboAddPhysician.Column(10)
rst2!ProctoreeMI = Me.cboAddPhysician.Column(11)
rst2!ProctoreeSuffix = Me.cboAddPhysician.Column(12)
rst2!ProctoreeLongDegree = Me.cboAddPhysician.Column(13)
rst2!TrainingCompletion_HospName = Me.cboAddPhysician.Column(2)
rst2!TrainingCompletion_HospID = Me.cboAddPhysician.Column(3)
rst2!Created = Now()

rst2.Update

Me.Filter = "LinkID= " & Me!cboAddPhysician.Column(0)
Me.FilterOn = True
Me.Requery
Me!cboAddPhysician.Value = ""
Me.Refresh
Me.cboFindMD.Visible = True
Me.cboAddPhysician.Visible = False
Set rst1 = Nothing
Set rst2 = Nothing
Set DB = Nothing

Exit Sub

PROC_ERR:
MsgBox "The following error occured: " & Error$
Resume Next
End Sub
================================================== ===
Private Sub cboAddPhysician_Exit(Cancel As Integer)
On Error GoTo PROC_ERR
Dim DB As Database
'Dim dbs As DAO.Database
Dim sSql As String

Set DB = CurrentDb()

' 1) Delete and append records
sSql = "DROP TABLE tblDFU_Hospitals_Product"
DB.Execute sSql
sSql = "SELECT qryDFU_Hospitals_Product.PrimInstID INTO
tblDFU_Hospitals_Product FROM qryDFU_Hospitals_Product;"
DB.Execute sSql

Set DB = Nothing
Exit Sub

PROC_ERR:
MsgBox "The following error occured: " & Error$
Resume Next
End Sub
================================================== ==

Any help you can lend to help with my troubleshooting would be
appreciated.

Henry

Sep 28 '06 #1
5 1877

Henry Stockbridge wrote:
Hi,

I have a combo box on a form whose purpose is to add a record to the
form's underlying table. There are several (16) fields that the combo
box carries with it, only a few that are visible to the User. When the
User selects a value from the combo box, the application shuts down.
Here is the code for the combo box that may lead to the problem.
Set a breakpoint at the first executable statement in your combo box
afterupdate event and then step through one line at a time until your
app crashes. This should give you some more information to go on (and
us too if you should require further assistance).

HTH,
Bruce

Sep 28 '06 #2

de***************@gmail.com wrote:
Henry Stockbridge wrote:
Hi,

I have a combo box on a form whose purpose is to add a record to the
form's underlying table. There are several (16) fields that the combo
box carries with it, only a few that are visible to the User. When the
User selects a value from the combo box, the application shuts down.
Here is the code for the combo box that may lead to the problem.

Set a breakpoint at the first executable statement in your combo box
afterupdate event and then step through one line at a time until your
app crashes. This should give you some more information to go on (and
us too if you should require further assistance).

HTH,
Bruce
Thanks for your answer. I neglected to say that the code
runs error free on my computer and one other workstation.
The procedure fails on all other computers. I am not that
adept at performance related issues, so could this be a
system (OS or MS Access) issue?

Nonetheless, I took the code and tested three iterations of
the procedure:
1 All code running in the After Update procedure (moved
the OnExit code to AfterUpdate)
2 RST1 procedure only
3 RST1 & RST2 procedures only

All work fine on my computer, the other workstation, and
crashes on all others. Any other ideas I should investigate
and test.

Thanks again,

Henry

Sep 30 '06 #3
"Henry Stockbridge" <hs***********@hotmail.comwrote in
news:11**********************@h48g2000cwc.googlegr oups.com:
>
de***************@gmail.com wrote:
>Henry Stockbridge wrote:
Hi,

I have a combo box on a form whose purpose is to add a
record to the form's underlying table. There are several
(16) fields that the combo box carries with it, only a few
that are visible to the User. When the User selects a
value from the combo box, the application shuts down.
Here is the code for the combo box that may lead to the
problem.

Set a breakpoint at the first executable statement in your
combo box afterupdate event and then step through one line at
a time until your app crashes. This should give you some
more information to go on (and us too if you should require
further assistance).

HTH,
Bruce

Thanks for your answer. I neglected to say that the code
runs error free on my computer and one other workstation.
The procedure fails on all other computers. I am not that
adept at performance related issues, so could this be a
system (OS or MS Access) issue?

Nonetheless, I took the code and tested three iterations of
the procedure:
1 All code running in the After Update procedure (moved
the OnExit code to AfterUpdate)
2 RST1 procedure only
3 RST1 & RST2 procedures only

All work fine on my computer, the other workstation, and
crashes on all others. Any other ideas I should investigate
and test.

Thanks again,

Henry
Go to one of the crashing computers.
Modify your procedure by adding the word stop in the location
shown

Private Sub cboAddPhysician_AfterUpdate()
stop 'add this command here, for testing.
'remove after the problem has been fixed

On Error GoTo PROC_ERR
Dim DB As Database

Run your process. when the event fires the program will stop and
display the code editor. Press the F8 key to execute one
statement at a time. the line to be next executed will be
highlighted (yellow on most computers). Press F8 and note which
line is highlited. Continue until the problem occurs. You will
have found the problem. Once we know what the problem is, we can
try to fix it..
--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Sep 30 '06 #4
Greetings Henry,
Thanks for your answer. I neglected to say that the code
runs error free on my computer and one other workstation.
The procedure fails on all other computers. I am not that
adept at performance related issues, so could this be a
system (OS or MS Access) issue?

Nonetheless, I took the code and tested three iterations of
the procedure:
1 All code running in the After Update procedure (moved
the OnExit code to AfterUpdate)
2 RST1 procedure only
3 RST1 & RST2 procedures only

All work fine on my computer, the other workstation, and
crashes on all others. Any other ideas I should investigate
and test.
The next things I would try are copying the working file from a machine
where the code executes correctly to one that doesn't, i.e., make sure
you are using identical versions of your program. Next make sure that
all machines are up to date with respect to service packs for
Office/Access (go to officeupdate.microsoft.com and click the 'check
for updates' link). Finally make sure that Windows on each machine is
also updated with the current service release. Although it is remotely
possible that you have some kind of hardware problem (i.e. bad RAM) it
is far far more likely to be a software issue.

Bruce

Oct 2 '06 #5

de***************@gmail.com wrote:
Greetings Henry,
Thanks for your answer. I neglected to say that the code
runs error free on my computer and one other workstation.
The procedure fails on all other computers. I am not that
adept at performance related issues, so could this be a
system (OS or MS Access) issue?

Nonetheless, I took the code and tested three iterations of
the procedure:
1 All code running in the After Update procedure (moved
the OnExit code to AfterUpdate)
2 RST1 procedure only
3 RST1 & RST2 procedures only

All work fine on my computer, the other workstation, and
crashes on all others. Any other ideas I should investigate
and test.

The next things I would try are copying the working file from a machine
where the code executes correctly to one that doesn't, i.e., make sure
you are using identical versions of your program. Next make sure that
all machines are up to date with respect to service packs for
Office/Access (go to officeupdate.microsoft.com and click the 'check
for updates' link). Finally make sure that Windows on each machine is
also updated with the current service release. Although it is remotely
possible that you have some kind of hardware problem (i.e. bad RAM) it
is far far more likely to be a software issue.

Bruce
Hi,

First, thanks for all your comments. They have been extremely helpful.
Well, I looked at the computers where the application crashed and
compared them to the working application computers, and alas, the
Access versions are different! The application does not crash on
Access version (11.6566.8036 - SP2), but it does crash on version
(11.5614.8036.) I will work on getting the latest service packs
installed, and see what happens.

Henry

Oct 2 '06 #6

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

Similar topics

5
by: Richard | last post by:
Hi, I have a form that take some time to load due to many comboboxes and at least 8 subforms. When I filter or sort the main form I get an error message and then Access shuts down. They ask if...
1
by: Robert Neville | last post by:
The solution to my dilemma seems straight-forward, yet my mind has not been forthcoming with a direct route. My Project form has a tab control with multiple sub-forms; these distinct sub-forms...
4
by: andersboth | last post by:
I want to run some code when my Windows Form Application is being shut down. I want to run this code when the Application is being shut down in the following situation: 1. The App is being...
2
by: DKode | last post by:
Ok, I restart the aspnet_wp.exe, memory usage is at about 3 mb, the first time I run one of my asp.net apps, the memory usage shoots to 30 mb usage and remains there. Even if I close the IE...
6
by: marcmc | last post by:
I have an icon that points at a server application written in dotNet. I wish to allow the users on distributed pc's to be able to close the application and walk away but I have to ensure that...
0
oll3i
by: oll3i | last post by:
Why my rmi server shuts down? when i run it it starts and then shuts down here is the server code import java.util.Properties; import javax.naming.InitialContext; import...
1
by: TC | last post by:
I'm experiencing an unusual problem. When I run a specific make-table query on a computer, that computer shuts down. The computer shuts down completely, without warning, as if a power failure...
1
by: nagar | last post by:
Hi, in a .NET 2.0 application, I'm noticing that sometimes the application simply crashes and exists without showing any message. I have the impression this has to do with some exceptions that are...
1
by: Cramer | last post by:
I'm running XP Pro/SP2 + patches and updates, with Visual Studio Professional 2008 (and no prior installation of Visual Studio ever installed). When attempting to open an ASP.NET Web application...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.