Results 1 to 14 of 14
  1. #1
    Join Date
    Apr 2004
    Location
    ny, ny
    Posts
    224

    Unanswered: conditional programming

    when entering data in a form i need to do some conditional programming
    i have 2 fields ... a yes/no field and a time field
    if it is a yes, the time should be auto entered else if no it should be left blank.

    thank you

  2. #2
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557

    Re: conditional programming

    Okay... you will need an Click() function for the check box

    so it will look like this

    Code:
    Private Sub yourcheckbx_Click()
        If yourcheckbx.value = -1 Then 'If value = true
            txt.value = Now()
        Else
            txt.value = ""
        End If
    End Sub

    Originally posted by fullymooned
    when entering data in a form i need to do some conditional programming
    i have 2 fields ... a yes/no field and a time field
    if it is a yes, the time should be auto entered else if no it should be left blank.

    thank you
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  3. #3
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557

    Sorry

    It should have been the afterupdate function.

    Code:
    Private Sub yourcheckbx_AfterUpdate()
        If yourcheckbx.value = -1 Then
            txt.value = Now()
        Else
            txt.value = ""
        End If
    End Sub
    If that Now() isnt the right format for you let me know and I will look up something else. (that may bring the date too.)

    JS
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  4. #4
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    Now() does bring the date too, which may be fine - just set the Format of the text box to one of the time settings.

    Including the date with your time becomes very useful when comparing or calculating deltas becasue the date prevents your operation from "round-robining" when you pass mid-night.

  5. #5
    Join Date
    Apr 2004
    Location
    ny, ny
    Posts
    224

    conditional programming

    in the switchboard click first shift and under the weir inspections when i change the cleaning required to yes , it should fill the time auto

    thanks

  6. #6
    Join Date
    Apr 2004
    Location
    ny, ny
    Posts
    224
    attachment

  7. #7
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557

    It didnt attach for some reason

    I dont see the attachement. I dont think it attached for some reason.

    JS
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  8. #8
    Join Date
    Apr 2004
    Location
    ny, ny
    Posts
    224
    seems like m unable to attach my file .. n e suggestions ?

  9. #9
    Join Date
    Apr 2004
    Location
    ny, ny
    Posts
    224
    trying to attach again

  10. #10
    Join Date
    Apr 2004
    Location
    ny, ny
    Posts
    224
    my file is a *.mdb file and i think its not a valid extension .. do u know how i cud attach a database file here

    thanks

  11. #11
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557
    What is your windows operating system? You should zip it in a Zip file using like WinZip 8.0 Trial or like winrar or some other program that can zip the file for you.

    If you are in windows xp all you have to do is right click the file and then down to send to>compressed folder.

    Hope that helps,
    JS
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  12. #12
    Join Date
    Apr 2004
    Location
    ny, ny
    Posts
    224
    zipped file
    Attached Files Attached Files

  13. #13
    Join Date
    Apr 2004
    Location
    ny, ny
    Posts
    224
    in the switchboard click first shift and under the weir inspections when i change the cleaning required to yes , it should fill the time auto

    thank you

  14. #14
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557

    Slight code Change

    Code:
    Private Sub weir10crcleaning_AfterUpdate()
        If weir10crcleaning.Value = "Yes" Then
           weir10crtime = Now()
        Else
           weir10crtime = ""
        End If
    End Sub
    ^^ is the new code. Replace your existing with that.

    If you want it to only show the time then format the field for that.

    Hope it works for you,
    JS
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

Posting Permissions

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