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.

Form Code Question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
nutmeg@questions.com - 31 Mar 2005 22:19 GMT
Hello, I have the attached code in AfterUpdate of a field that selects a
project number.  What I would like to have happen is when the land on the
field, select 0080 and it is incorrect and they say No, that it goes back to
the field and stays there until they change it, but this isn't working, it is
just carrying on to the next code.  I thought the 'SetFocus' would keep it
there but it doesn't seem to be working.  Any help gratefully accepted.
IEJ

Private Sub OurProjectNumber_AfterUpdate()
   
   Dim Message As String
   
   If OurProjectNumber.Value = "0080" Then

  If MsgBox("You have selected the VProject Number. Is this the " _
       & "Project Number you want?", vbYesNo + vbQuestion) = vbNo Then
       MsgBox ("Please select correct Project Number from dropdown list")
       Me.OurProjectNumber.SetFocus
    End If
Jeff - 31 Mar 2005 22:23 GMT
Hello,

Move the code to the Before Update Event & then if you want to keep the focus,
put Cancel = true; remove the Me.OurProjectNumber.SetFocus.

Jeff

> Hello, I have the attached code in AfterUpdate of a field that selects a
> project number.  What I would like to have happen is when the land on the
[quoted text clipped - 15 lines]
>         Me.OurProjectNumber.SetFocus
>      End If
 
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.