Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    5 Star Lounger
    Join Date
    Mar 2004
    Posts
    924
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Automatically placing data in fields (2000)

    Is it possible to produce a procedure that would enable fields to go blank automatically and also place the date in a specified field.
    This should occur on selecting ".completed" from the drop down menu, see attachment.
    It would be greatly appreciated if this is possible.

    Regards
    Justin.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Automatically placing data in fields (2000)

    You would do that in the After Update event of the combo box. If the value of the combo box is ".Completed", set the controls you want to clear to Null, and the control you want to contain the current date to Date.

  3. #3
    5 Star Lounger
    Join Date
    Mar 2004
    Posts
    924
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatically placing data in fields (2000)

    I am not to sure what you mean about the last bit with regards "If the value..." is it possible to include a screen shot.

    Regards
    Justin

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatically placing data in fields (2000)

    In the after update event of the combo box enter code like this :

    Private Sub CurrentOwnerCombo_AfterUpdate()
    If Me.CurrentOwnerCombo = ".Completed" Then
    Me.CompetedDate = Date
    Me.GivenToOwner = Null
    Me.EmailReminderSent = Null
    Me.DateReminderDue = Null
    End If
    End Sub

    Replace the name of the text and combo boxes WITH THE NAMES YOU USE IN YOUR FORM. PLEASE DON'T COPY THE CODE I SEND YOU.
    Francois

  5. #5
    5 Star Lounger
    Join Date
    Mar 2004
    Posts
    924
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatically placing data in fields (2000)

    I have tried to use this coding but appear to get an error.
    I have check the names l have used on my form and think they are correct.
    The only section of the coding l have kept the same is the CurrentOwnerCombo field,as l have used Current Owner as my field name,not to sure if this is correct or not.

    Regards
    Justin.

  6. #6
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatically placing data in fields (2000)

    According to the name of the sub (Private Sub Current_Owner_AfterUpdate()) the line should be :
    If Me.Current_Owner = ".Completed" Then
    Why don't you use the trick I give you yesterday :
    Me.
    And scroll down to the name of the combo ?
    Francois

  7. #7
    5 Star Lounger
    Join Date
    Mar 2004
    Posts
    924
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatically placing data in fields (2000)

    I now appear to be getting another error.
    Any suggestions?

    Justin.

  8. #8
    5 Star Lounger
    Join Date
    Mar 2004
    Posts
    924
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatically placing data in fields (2000)

    this is better example of the error.

    Justin

  9. #9
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatically placing data in fields (2000)

    That's again a wrong name of a textbox.
    Francois

  10. #10
    5 Star Lounger
    Join Date
    Mar 2004
    Posts
    924
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatically placing data in fields (2000)

    I assume the text box name is the name highlighted in the attachment?
    Is this correct?

    Justin.

  11. #11
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatically placing data in fields (2000)

    Yes, and the name is Remindersent and not Emailremindersent like you use in the code
    Francois

  12. #12
    5 Star Lounger
    Join Date
    Mar 2004
    Posts
    924
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatically placing data in fields (2000)

    This appears to work fine now, apart from one thing and that is that the current date i.e "completed date" is not shown.
    Any ideas as to what could be wrong?

    Justin.

  13. #13
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Automatically placing data in fields (2000)

    You had a similar problem with setting the date in the thread starting with <post#=444636>post 444636</post#>. Does it work if you use

    Me.CompletedDate = Int(Now)

    instead of ... = Date?

  14. #14
    5 Star Lounger
    Join Date
    Mar 2004
    Posts
    924
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatically placing data in fields (2000)

    That works great.
    Thanks for your help.

    Justin.

  15. #15
    5 Star Lounger
    Join Date
    Mar 2004
    Posts
    924
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatically placing data in fields (2000)

    Is is possible to get this coding to work in datasheet view by any chance as it works fine in form view.

    Justin.

Page 1 of 2 12 LastLast

Posting Permissions

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