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 / January 2007

Tip: Looking for answers? Try searching our database.

NotInList Problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sher - 30 Jan 2007 18:10 GMT
I have (3) NotInList in my database.  One for TYPINV, one for SSN and one for
Organization.  They are exactly the same.  My problem is only Organization
works.  The other two keep saying an error occured, please try again.  What
can I do to get this from occurring and have the information appear.

Private Sub ORGANIZATION_NotInList(NewData As String, Response As Integer)
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strMsg As String

   strMsg = "'" & NewData & "' is not an available Organization " & vbCrLf
& vbCrLf
   strMsg = strMsg & "Do you want to add the new Organization to the
current list?"
   strMsg = strMsg & vbCrLf & vbCrLf & "Click Yes to add."
   
   If MsgBox(strMsg, vbQuestion + vbYesNo, "Add new Organization?") = vbNo
Then
       Response = acDataErrContinue
   Else
       Set db = CurrentDb
       Set rs = db.OpenRecordset("Organization", dbOpenDynaset)
       On Error Resume Next
       rs.AddNew
           rs!ORGANIZATION = NewData
       rs.Update
       
       If Err Then
           MsgBox "An error occurred. Please try again."
           Response = acDataErrContinue
       Else
           Response = acDataErrAdded
       End If
       rs.Close
       Set rs = Nothing
       Set db = Nothing
   End If
End Sub
Douglas J. Steele - 30 Jan 2007 18:20 GMT
Change from

MsgBox "An error occurred. Please try again."

to

MsgBox "Error " & Err.Number & " (" & Err.Description & ") occurred. Please
try again."

and tell us what the error is.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

>I have (3) NotInList in my database.  One for TYPINV, one for SSN and one
>for
[quoted text clipped - 36 lines]
>    End If
> End Sub
Sher - 30 Jan 2007 19:35 GMT
Hello Douglas

That is still not working.

> Change from
>
[quoted text clipped - 47 lines]
> >    End If
> > End Sub
Douglas J. Steele - 31 Jan 2007 21:49 GMT
What error was reported when you made the change?

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

> Hello Douglas
>
[quoted text clipped - 57 lines]
>> >    End If
>> > End Sub
 
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.