Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple code crashes Access

Status
Not open for further replies.

ViperD

IS-IT--Management
May 1, 2003
27
US
Here is my code:

Private Sub Primary_Pymt_LostFocus()
Dim sBillingFee As String
Dim sClaimType As String 'Contains the Claim type
Dim aQueryResults(0 To 10) As String
Dim iPatientSSNum As Integer

sBillingFee = Primary_Pymt * 0.065
iPatientSSNum = PatientSS#

Me.Billing_Svc_Fee1.Value = sBillingFee
Me.Net_to_CDG1 = Primary_Pymt - sBillingFee


'if Global
'Me.Net_to_Dr1 = Primary_Pymt / 2
'aQueryResults =

'DoCmd.RunSQL "SELECT PaymentType From CustomerTable where CustomerID=" & "1234"
'DoCmd.RunSQL ("Select Claim_Type,Primary_Pymt from Tests where [PatientSS#]= '" & Forms!whatevertheformname is[PatientSS#] &+"'")
db.Execute ("Select Claim_Type,Primary_Pymt from Tests where PatientSSNum=" & Form![PatientSSNum])


End Sub


From here I enter a blank line at the end of the Dim statements. I then start to type:

Dim xyz as DAO

but when I press the space bar after as msaccess.exe creats an error and is shut down completely. Any suggestions?
 
a few things to try
1) create a new, blank database.
2) press ^G to open a debug window. Select tools:References and make sure that Microsoft DAO 3.6 object libray is selected. If you don't have 3.6, select the nearest match
3) import all the objects from your current database into the new database.

You might also try opening your current database using a shortcut and the decompile switch:

&quot;c:\program files\microsoft office\office\msaccess.exe&quot; <database name> /decompile

NOTE: if you are using office XP, the path is different, instead of \office\ it's \office10
If all that doesn't work, try re-installing office.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top