Results 1 to 8 of 8
  1. #1
    FL0XN0X is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Location
    Belgium
    Posts
    84

    Main form contains 2 controls: ID (Primary Key of Date Table) and DatePicker. How to update ID when

    Hi,



    So I have a main form that is linked to a subform.
    The main form contains 2 controls. The first control is a Textbox, showing the ID (which is primary key of a Table holding Dates between 2015 and 2049) of the Date. The second control, is a Date Picker. The subform that is linked shows the detailed data of the corresponding Date selected in the main form.
    However, when I choose a date in the mainform using the Datepicker, the ID in the Textbox is not updated accordingly, resulting in the subform not showing the correct data (because the ID I the mainform did not change).

    Can someone explain how I can update this ID textbox so it corresponds to the selected Date using the datepicker.

    VERYYYYYYYYYYY much appreciated.
    Kind regards,
    Bart

  2. #2
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    You mean an actual Calendar control, or the built in date picker that shows up at textboxes when they're based on a date (provided your option settings allow)? If the latter, a simple AfterUpdate event should do the trick. Question is, is the form (along with that control) bound? If so, requery the main form in the event. If the control isn't bound, you requery the control. The subform should reload data based on the textbox value being changed (assuming that's the common link).
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    FL0XN0X is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Location
    Belgium
    Posts
    84
    Hi, I'm new here. I can upload the access DB if you want?

  4. #4
    FL0XN0X is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Location
    Belgium
    Posts
    84

    Arrow Screenshots

    Click image for larger version. 

Name:	first.png 
Views:	13 
Size:	55.2 KB 
ID:	32216Click image for larger version. 

Name:	second.png 
Views:	13 
Size:	21.3 KB 
ID:	32217

    it concerns the bilt-in date picker. The controls are bound.
    Last edited by FL0XN0X; 01-17-2018 at 03:00 PM. Reason: Add ifo

  5. #5
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    U should be able to upload a copy. Compact/ repair then zip before uploading. The process isn't the most intuitive I've seen but you can try. That way others can chip in too.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    FL0XN0X is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Location
    Belgium
    Posts
    84
    Here it is. It concerns the Form 'Kalender'
    Attached Files Attached Files

  7. #7
    FL0XN0X is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Location
    Belgium
    Posts
    84
    When using the record selectors I the bottom, the ID control in the main forms gets updated and subforms correctly displays data in the subform

  8. #8
    FL0XN0X is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Location
    Belgium
    Posts
    84

    Thumbs up

    Dlookup in Update event did the trick. Thank you.

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

Similar Threads

  1. Replies: 2
    Last Post: 10-17-2016, 09:16 AM
  2. Replies: 2
    Last Post: 10-10-2014, 05:33 AM
  3. Replies: 5
    Last Post: 02-16-2014, 02:50 PM
  4. Replies: 1
    Last Post: 10-26-2012, 03:27 PM
  5. Replies: 8
    Last Post: 03-22-2012, 08:48 AM

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