Results 1 to 4 of 4
  1. #1
    Desstro's Avatar
    Desstro is offline Competent Performer
    Windows XP Access 2010 (version 14.0)
    Join Date
    May 2010
    Posts
    185

    On Click Event For Button On Form

    See attached image.

    Notice the button in top left, "Day/Night"

    I have a 24hour a day operation where I have a crew lead on each shift, day and night. They will be filling out this form.

    Instead of making 2 identical forms, can I enter code into an on click event that will switch the form from what you see in the image to a blank form?

    I would want it so that when you click back, the data that was there is still there.

    Possible?

    If so What would that code look like?

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    All I can advise is very generic in that 'day/night' are relative terms and one must be specific in telling a db which records to display. So you must establish a method that the press of that button the db can determine which record range or time range is to be used - and then change the record source of the form to the correct records.

    Probably not a whole lot of help here but that is your challenge.

    It may be relatively clear cut such as selecting between 2 different criteria in the underlying query depending on the current PC time.

  3. #3
    Desstro's Avatar
    Desstro is offline Competent Performer
    Windows XP Access 2010 (version 14.0)
    Join Date
    May 2010
    Posts
    185
    Both Day and Night will be pulling different data from the same table.

  4. #4
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    Yes understood. The form is assummed to be sourced on a query. The query has criteria defining which records are displayed.

    Selecting the day/night button would change that criteria.

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

Similar Threads

  1. Replies: 1
    Last Post: 03-03-2010, 07:29 PM
  2. VB coding for saving when click on save button in form
    By cwwaicw311 in forum Programming
    Replies: 1
    Last Post: 02-04-2010, 11:11 PM
  3. Replies: 3
    Last Post: 10-18-2009, 09:17 AM
  4. On Click Event Procedure
    By MrDean in forum Forms
    Replies: 3
    Last Post: 10-07-2009, 07:16 AM
  5. On-Click event transfer
    By nkenney in forum Forms
    Replies: 16
    Last Post: 03-26-2009, 09:02 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