Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    force the operator to select ( )

    I

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: force the operator to select ( )

    BeforeUpdate should work, and it will keep the user in the combobox--that's what the Cancel argument is for after all. What I would do is change your test routine to a function and make sure it returns a True if the driver is already logged in and a False if not. Then put a line in the BeforeUpdate event that says
    <hr>Cancel=ChkDriver()<hr>
    That would result in the cursor staying in the combobox if it turned out that the driver was already logged in, which is what I think you're trying to do. Then what you do is something like this, assuming your combobox is named cmbDriverName:

    <pre>Private Sub cmdDriverName_BeforeUpdate(Cancel As Integer)

    <font color=448800>'if the driver is logged in, cancel</font color=448800>
    Cancel=ChkDriver()

    If Cancel=True Then

    <font color=448800>'undo the selection
    'this leaves the record in edit mode</font color=448800>
    cmdDriverName.Undo

    <font color=448800>'this undoes the edit entirely
    'if you want to go that far</font color=448800>
    Me.Undo
    End If <font color=448800>'Cancel=True </font color=448800>
    End Sub <font color=448800>cmdDriverName_BeforeUpdate( _
    Cancel As Integer)</font color=448800></pre>

    Charlotte

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: force the operator to select ( )

    Dear Charlotte,
    Thank you for helping me with this code, I got it working a treat!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •