Results 1 to 6 of 6
  1. #1
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287

    Toggle switch on form to edit date in a table

    Hey guys,

    I am working on a program to streamline our marketing process. I have attached 3 snippets: One of the user's form, one of the table that it is attached to, and the code that I can't get to work. Everything in the form is very basic and just directly linked to the table, except for the "Add to List" toggle switch. "No" (value of 2) is the default value for this button. Note the field on the form labeled "Ad Date" and a field in the table labeled "NextMailed."

    The desired process is for a user to hit "Yes" on that toggle switch for the desired customers. When the switch is toggled to "Yes," the "AddToList" value in the table changes to 1, and the date that is in "Ad Date" on the form is inserted into the "NextMailed" field in the table. Another process later on will move that date from "NextMailed" to "LastMailed." Hitting the toggle switch back to "No" changes the AddToList value back to 2, and should clear out the NextMailed date.




    Issues:

    -Toggling back to No gives me a debug error, saying there is a syntax error with the UPDATE
    -Toggling to Yes gives no error, but the NextMailed date is just a time. Returns 12:00:01 AM

    Any help would be greatly appreciated!

    The method behind my madness here was completely thought of in my head. So if there is a smarter way to accomplish this, I am all ears.



    Click image for larger version. 

Name:	Screen Shot 2014-10-02 at 3.44.17 PM.png 
Views:	12 
Size:	40.1 KB 
ID:	18290Click image for larger version. 

Name:	Screen Shot 2014-10-02 at 3.43.35 PM.jpg 
Views:	12 
Size:	47.8 KB 
ID:	18291Click image for larger version. 

Name:	Screen Shot 2014-10-02 at 3.47.45 PM.png 
Views:	12 
Size:	45.4 KB 
ID:	18292

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Is that form bound to T_Dreamrooms table? If yes, why use UPDATE actions? Just set the value of the field that is in the form RecordSource.

    Is the frame value getting changed with each toggle click? Don't think need frame if there is only the one toggle. Radio, check, and toggle buttons can work independent of frame.
    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.

  3. #3
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287
    The form is bound to a query that is built on that table. I didn't even think about doing it that way. I always over think things

    Never used a toggle without a frame. How does the code work? Do you put code on the afterupdate for each toggle?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    A solo Radio, Check, or Toggle is much like any other data control. Bind to field. Code in events. For a Toggle, Click event maybe best.
    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.

  5. #5
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287
    Having a brain fart. Can't set the [NextMailed] field. No error or anything, just isn't working.

    I put

    [NextMailed] = me.AdDate

    On click.

  6. #6
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287
    Durrrr. AdDate is on the parent form. Forms!F_GalleySelections!NextAdDate got it. Working beautifully.

    Thanks June7!

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

Similar Threads

  1. Replies: 2
    Last Post: 09-17-2014, 09:35 AM
  2. Control Button to toggle edit mode
    By Leonidsg in forum Programming
    Replies: 2
    Last Post: 03-19-2013, 06:53 PM
  3. Search table in form / edit data in form
    By Guitarzan in forum Access
    Replies: 3
    Last Post: 10-02-2012, 11:37 AM
  4. Replies: 16
    Last Post: 09-12-2012, 08:39 AM
  5. Replies: 1
    Last Post: 08-13-2010, 10:10 PM

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