Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / March 2005

Tip: Looking for answers? Try searching our database.

What On Event procedure do I need?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Darren - 31 Mar 2005 10:09 GMT
I have a database that sits on SQL Server 2000 and users are restricted on
what actions they can perform on the objects.  Via ODBC I have an Access
database for the forms, reports etc.

One of the forms uses a subform and here is the problem.  The underlying
table of the subform can only be viewed by certain users thus if they tried
to change, delete or update a record, SQL Server would say "denied".  Inside
the subform I have used an error trap that will convert the SQL Server
message into something more understandable to the end-user.  If they click
on a save button within the subform the message displays as intended,
however, if they change something then click on a field in the main form,
they get the obscure SQL Server error instead.

My question is, how can I get the same user-friendly message if they either
click on save in the subform or move the focus to a field in the main form?
I have tried adding the message code to the sub-form's "On Lost Focus" event
but this does not work.  I also added the same code to the "On Error" event
for both forms but again no joy.  After the message is displayed using the
msgbox command I also have DoCmd.RunCommand acCmdUndo so that any changes
they tried to make is removed.  If I did not do this, the user would be
trapped on the form and could only exit by closing Access.

I have also used the same code in the OnError events for both the subform
and main form to no avail.

Any advice would be greatfully received.

Regards
Dazza
Ron Weiner - 31 Mar 2005 13:32 GMT
Use the Subform Control's "OnExit" Property.  I am talking about the control
that hosts your subform on the parent form, and not the subform itself.

Ron W
> I have a database that sits on SQL Server 2000 and users are restricted on
> what actions they can perform on the objects.  Via ODBC I have an Access
[quoted text clipped - 25 lines]
> Regards
> Dazza
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.