Results 1 to 12 of 12
  1. #1
    DefinitelyMaybe is offline Advanced Beginner
    Windows 10 Access 2002
    Join Date
    Dec 2020
    Posts
    65

    Refresh Form when scrolling through records

    Hi Everyone,



    I have an unbound field (project description) which is tied to a bound field (project number) that does not update when I scroll through the records. Is there a refresh of the form on click the directional buttons? (Well I know there is but don't know it!)

    Thanks for your help,

    Eric

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    Hi Eric,

    It is the Current event of the form that you want to use to requery the unbound control. Can I assume you have the unbound on the main form and you're scrolling through the subform records?

    In the subform's Current event add Me.Parent.Form.Controls("txtProjectDescription").R equery

    Cheers,
    Vlad
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  3. #3
    DefinitelyMaybe is offline Advanced Beginner
    Windows 10 Access 2002
    Join Date
    Dec 2020
    Posts
    65
    Hi Vlad!

    Different from my last issue... both of these fields are in the main form. Would I add the requery Current event as you suggest (minus the Parent part) in the project description field?

    Thanks

    Eric

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    Yes, I think so. What is the control source for the unbound field (or how do you populate it)? Can't you replace it with a combo box (with a row source of "Select ProjectID, ProjectDescription from tblProject;") with two columns and set the first one's width to 0 (it would have to be bound to ProjectID)?

    Cheers,
    Last edited by Gicu; 02-11-2021 at 09:19 AM.
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #5
    DefinitelyMaybe is offline Advanced Beginner
    Windows 10 Access 2002
    Join Date
    Dec 2020
    Posts
    65
    Hi Vlad,

    I discovered the driver is the change in business unit. When I open up the form and starts at the first record and I scroll through, the first 4 records have the same business unit and the project number and description update fine, when it gets to the fifth record, the business unit changes, the project number updates but the description shows blank since it us unbound. I did try to do as you suggest and create a combo box but don't want a drop down and it isn't tied to a field in the table. The point of this field is only to remind the inputter of the project number they selected.

    Thanks,

    Eric

  6. #6
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    Hi Eric,

    How do you populate it? Is it a dLookup? What do you currently have in the "unbound" textbox control source?

    Cheers,
    Vlad
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  7. #7
    DefinitelyMaybe is offline Advanced Beginner
    Windows 10 Access 2002
    Join Date
    Dec 2020
    Posts
    65
    Hi Vlad,

    It looks to the project number field which references project number and project description and looks to column(1).

    Thanks

    Eric

  8. #8
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    So the project number is a combo. Try to requery it in the Current event.

  9. #9
    DefinitelyMaybe is offline Advanced Beginner
    Windows 10 Access 2002
    Join Date
    Dec 2020
    Posts
    65
    The project number is updating clicking through the records it is the description that isn't updating when the business unit changes. It seems like the project description field needs to be refreshed rather than the project number being requeried. Does that make sense?

    Thanks,

    Eric

  10. #10
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    But the description is coming from the second column of the project number, so I would suggest you try to requery both in the Current event of the form:

    Code:
    Me.cboProjectNumber.Requery  'adapt for your names
    Me.txtProjectDescription.Requery
    I assume your project number combo has a reference to the current business unit in its row source, so if you requery it you should get the description.
    Cheers,
    Vlad
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  11. #11
    DefinitelyMaybe is offline Advanced Beginner
    Windows 10 Access 2002
    Join Date
    Dec 2020
    Posts
    65
    Bingo! Thanks again Vlad. By the way, love your German Shepard. I had one growing up. They are the best!

    Eric

  12. #12
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    You're very welcome Eric, glad you got it working! Yes, love the GSD, they are truly amazing pups!

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

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

Similar Threads

  1. Scrolling records on non-continuous form
    By Euler271 in forum Programming
    Replies: 2
    Last Post: 04-11-2018, 09:08 AM
  2. Replies: 4
    Last Post: 02-11-2016, 11:22 AM
  3. Scrolling through Sub-Form Records
    By wscwt01 in forum Access
    Replies: 1
    Last Post: 06-27-2014, 02:29 PM
  4. Replies: 10
    Last Post: 03-29-2012, 10:44 AM
  5. Form - turn off scrolling records
    By jalb in forum Forms
    Replies: 7
    Last Post: 01-23-2012, 06: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