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

Tip: Looking for answers? Try searching our database.

Why doesn't this work?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ripper - 24 Jul 2005 23:51 GMT
I received this code from Albert Kallal and it works great Except I cannot
seem to get the code to work with combo boxes I populate with information
from queries I use to alphabetize names.  Anyone know why it won't work with
the combo boxes?

Private Function MyVerify() As Boolean

  Dim colFields     As New Collection

  MyVerify = False

  colFields.Add "Period,Period"
  colFields.Add "Reason,Dress Code Reason"
  colFields.Add "Student,Student Name" <----combo box (cboStudentName)
  colFields.Add "Teacher,Teacher Name"
 
  MyVerify = vfields(colFields)

End Function

Private Function vfields(colFields As Collection) As Boolean

  Dim strErrorText  As String
  Dim strControl    As String
  Dim i             As Integer

  vfields = False

  For i = 1 To colFields.Count
     strControl = Split(colFields(i), ",")(0)
     strErrorText = Split(colFields(i), ",")(1)
     If IsNull(Me(strControl)) = True Then

        MsgBox strErrorText & " is required", vbExclamation, AppName
        Me(strControl).SetFocus
        vfields = True
        Exit Function
     End If
  Next i

End Function
Signature

Thanks As Always
Rip

Ripper - 25 Jul 2005 05:07 GMT
Never mind.  I figured it out.  I had a default value of 0 in the field, so
it was never actually empty.  Sorry for the hassle.
Signature

Thanks As Always
Rip

> I received this code from Albert Kallal and it works great Except I cannot
> seem to get the code to work with combo boxes I populate with information
[quoted text clipped - 37 lines]
>
> End Function
 
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.