Results 1 to 11 of 11
  1. #1
    rebel_yell is offline Novice
    Windows 8 Access 2000
    Join Date
    May 2014
    Location
    Durham, UK
    Posts
    6

    Question checkbox and Textbox link

    Hiya!

    Beginner here so apologies in advance if there is already a thread about this.



    My question is; is there a way that once a checkbox is ticked (returns TRUE) can it populate the time, date and current user at the same time.

    ive got separate fields for this, however, nothing i have tried actually returns any result!

    Any help is appreciated

    thanks in advance

    adam

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    In your afterupdate event for the checkbox, something along these lines. Change Control names to what is in your Form.
    Code:
    If me.chkboxName = TRUE then
    me.TimeNameField = Time
    me.DateNameField = Date
    me.UserNameField = Environ("UserName")
    End if

  3. #3
    rebel_yell is offline Novice
    Windows 8 Access 2000
    Join Date
    May 2014
    Location
    Durham, UK
    Posts
    6
    Hi!

    This, is awesome, however, the case already has a time field in it and when the code is ran, it updates both time fields - i can only assume that it would be the same for the date too?

    is there any way of keeping the original values in the existing record field and update the new fields with the new information?

    thanks again

    adam

  4. #4
    rebel_yell is offline Novice
    Windows 8 Access 2000
    Join Date
    May 2014
    Location
    Durham, UK
    Posts
    6
    apologies - the above is incorrect - it just mirrors the existing time in the record i.e: time logged - 15:17:30 - then your updated time mirrors this - whereas i need this to be the time the checkbox is ticked?

    sorry to be a pain

    adam

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    What are the names of fields? Alan's code should be doing exactly what you want, populating only the referenced fields with current date/time and user. Why aren't date/time in a single field?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    rebel_yell is offline Novice
    Windows 8 Access 2000
    Join Date
    May 2014
    Location
    Durham, UK
    Posts
    6
    hiya june7

    there are two different date fields, the date the record was logged and the date it was amedned; let me tell you about what im trying to achieve.

    as a call centre, sometimes when we are innundated with calls we take a 'callback' currently these are kept on paper and are often lost / thrown away / not done so we have decided to set up a database to log who takes the call back and when - but also when the call back is actually dialled on and who by.

    alans information is spot on, but as there is already a date/time field in the record, it seems to be populating the same time as the time the record was logged (the time the original call was taken) and not populating the time the time it was dialled on to return the call to the customer (operated by the dialled y/n checkbox)

    would i help if i uploaded the database? its not all that big as still in development

    thanks

    adam

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    By all means, provide db. Never hurts.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    rebel_yell is offline Novice
    Windows 8 Access 2000
    Join Date
    May 2014
    Location
    Durham, UK
    Posts
    6
    it appears its too large. 1.3mb

    heres a link to the google drive where you can get it

    https://drive.google.com/file/d/0B8J...it?usp=sharing

    thanks

    adam :0

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    Run Compact & Repair then zip the db. 2MB zip attachment is allowed.

    Date and Time are reserved words (because they are functions). Should not use reserved words as field names. Also advise no spaces or special characters/punctuation (underscore is exception) in naming convention.

    Presume form involved is [Callbacks to Call].

    Bizarre, even after changing field names, the Dialled date and time saved is still same as the login date and time.

    More weirdness - VBA events run but debug doesn't stop on breakpoint. Never seen this before. Makes debugging a bit difficult.

    I have no explanation for this other than possible corruption - which is usually the case with bizarre and weird. I created a new form with new controls and the code correctly populates the Dialled_by, Dialled_On, Dialled_Time textboxes. However, still doesn't stop on breakpoints.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  10. #10
    rebel_yell is offline Novice
    Windows 8 Access 2000
    Join Date
    May 2014
    Location
    Durham, UK
    Posts
    6
    sorry for the horrendously late reply, had a lot on my plate!

    do you think that by changing the date/time fields would resolve the situation?

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    Changing them how - making a single field? No, don't think that will fix the issue. Note my comment about creating a new form.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 01-14-2014, 04:17 PM
  2. Replies: 3
    Last Post: 12-14-2012, 08:59 AM
  3. Replies: 8
    Last Post: 11-19-2012, 09:22 AM
  4. Insert Multiple Checkbox Values to one Textbox
    By dshillington in forum Programming
    Replies: 1
    Last Post: 12-28-2011, 10:10 AM
  5. Combining textbox and checkbox data
    By jgarner in forum Access
    Replies: 0
    Last Post: 12-11-2008, 11:10 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums