Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Microsoft Access > Trapping/disabl...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 30173 of 30680
Post > Topic >>

Trapping/disabling runtime error 30014

by Jim Armstrong <armstrongjc@[EMAIL PROTECTED] > May 5, 2008 at 12:38 PM

Hello all -

This is driving me crazy. I have a table called tblClients - very
simple, has the following fields:

taxID (PK)
ClientName
SalesName

The main form of my application allows a user to select a client and
shows sales transactions on a subform. I wanted to include a button
the user could click which would allow them to edit the client
information. So, I created a form called frmEditClient which is loaded
when the button is clicked. Code on the OnClick event for the code
button:

Private Sub cmdEditClient_Click()
Dim LinkCriteria As String
LinkCriteria = "[ClientName]= '" & Me.txtSelectedCLient & "'"
DoCmd.OpenForm "frmEditClient", , , LinkCriteria
End Sub

Pretty simple, just opens the EditClient form using the current client
in the recordsource - this opens the form and the user can edit
details and save the form. The recordsource of frmEditClient is a
query called vwEditClient that selects all from tblClients (tried
using tblClients as record source - same problem)

Only problem is if the user wants to edit the ClientName field - since
frmEditClient is using the ClientName field as a filter, I get a
runtime error 30014 - the data has been added but cannot be displayed
because it no longer meets the criteria of the underlying
recordsource.

I know *why* I'm getting the error, I just want to stop it. I've tried
to trap the damn thing, but can't seem to get it to trap - the error
is generated on the "me.dirty=false" line, and this stops any code
after from running. I have tried to put On Error Goto 0 at the
beginning of the sub, etc..., but nothing seems to trigger.

Here is the code for the Save button, without any error handling:

Private Sub cmdSave_Click()
If Me.Dirty Then
    Me.Dirty = False
Else
    MsgBox ("No changes were detected - please make your changes, or
hit Cancel to return to the previous screen")
    Exit Sub
End If
DoCmd.Close acForm, "frmEditClient"
End Sub

All I want is:

1) A way to load the frmEditClient so the form displays the client
that was selected on the main form
2) A way to suppress or hide the runtime error that occurs when the
user edits the clientname.

Can someone assist with a way to trap this error or prevent it from
happening?

Thanks
 




 4 Posts in Topic:
Trapping/disabling runtime error 30014
Jim Armstrong <armstro  2008-05-05 12:38:28 
Re: Trapping/disabling runtime error 30014
Jim Armstrong <armstro  2008-05-05 13:17:40 
Re: Trapping/disabling runtime error 30014
Salad <oil@[EMAIL PROT  2008-05-05 15:32:53 
Re: Trapping/disabling runtime error 30014
diogenes <light@[EMAIL  2008-05-05 22:48:41 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Wed Jul 9 0:56:39 CDT 2008.