Solved Text box not updating as form record source changes (1 Viewer)

adhoustonj

Member
Local time
Today, 04:37
Joined
Sep 23, 2022
Messages
150
Hello AWF,
I'm having a problem with a text box value not updating as the form record source is being updated. This was working fine with an Access back end, but now that I have migrated to sql server it does not.

The attached sample database is my attempt to simply explain the problem.
  1. User opens database to the home page and see the score (Starts at 0 for the day)
  2. User clicks on the 1-5 buttons to "work" and as they close each form, the score is updated

This works fine in the sample - but with the SQL server backend it does not show the updated score until the home page form (frmHome) is closed and reopened.
I've tried using a 30 second timer in the version linked to SQL server and calling me.refresh, me.recalc, me.txt_score.requery, but the value never updates.

The form record source is a query to the tblScores. If I look in the table the score is updated, but not reflected on the form.

Any tips? Or should I use a different event? I was thinking maybe the got on focus event to the home page, but still unsure how to make it display the current value in the table vs what was originally in the table when the form was opened and what the record source query returned at the time of open.


Thanks
 

Attachments

  • Database19.accdb
    960 KB · Views: 54

bastanu

AWF VIP
Local time
Today, 01:37
Joined
Apr 13, 2010
Messages
1,402
Have you checked the Access client settings, specifically try to tweak the ODBC Refresh Interval.

Cheers,
 

adhoustonj

Member
Local time
Today, 04:37
Joined
Sep 23, 2022
Messages
150
Thanks for the suggestion. Unfortunately it didn't fix the issue.

I had a recordsource that had form control references.. I changed them to variables in VBA and set my recordsource with a sql string, and now is working okay. 🤦‍♂️ silly me.
 

Users who are viewing this thread

Top Bottom