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 / November 2005

Tip: Looking for answers? Try searching our database.

Any obvious errors?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
albycindy - 28 Nov 2005 11:57 GMT
I took this code straight out of Northwind and modified it for my subform.  
Can anyone see any glaring errors?

Private Sub ActionID_AfterUpdate()
On Error GoTo Err_ActionID_AfterUpdate

   Dim strFilter As String

   strFilter = "ActionID = " & Me!ActionID
   
   Me!Action = DLookup("Action", "tblAction", strFilter)
   Me!ActionType = DLookup("ActionType", "tblAction", strFilter)

Exit_ActionID_AfterUpdate:
   Exit Sub

Err_ActionID_AfterUpdate:
   MsgBox Err.Description
   Resume Exit_ActionID_AfterUpdate

End Sub

I don't know what's going wrong. When I select the ActionID in subform
frmReturns, an error message tells me that it doesn't have that automation
object. I can't find automation object anywhere in help and I don't know what
it means...!

TIA
John Vinson - 28 Nov 2005 16:58 GMT
>I don't know what's going wrong. When I select the ActionID in subform
>frmReturns, an error message tells me that it doesn't have that automation
>object. I can't find automation object anywhere in help and I don't know what
>it means...!

It probably means that you're referencing the wrong control name or
the wrong form name. If there is no field or control named ActionID on
the form which contains this code you'll get this error.

If the code is on the mainform, and ActionID is on a subform, you need
to explicitly reference the path to the subform:

Me!frmReturns.Form!ActionID

instead of just Me!ActionID.

                 John W. Vinson[MVP]    
 
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.