Refresh problem ...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am updating a field directly in the database. However, even though the form
is requeried thereafter, it doesn't display the latest value from the
database.

How can I refresh the value?

I already tried Me.Requery at various places.

Thank you,
-Me
 
If you update one field in a record in a table, how does your form know
which record to display?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Jeff,

I am in the same record and I tried to requery the form for the same record.

I have parent form on click of a button, I bring up another form in which I
update
value of a field in the parent form. When I close the 2nd form, control
comes back to the 1st form whose field I just updated using update statement
in the 2nd form. I am hoping to see the updated value in the 1st form.

Thank you,
-Me
 
if a field is bound to a control(s) - wherever it is (they are) - the
control(s) will always reflect the current field value (without a refresh)

which suggests one or both of the controls are not bound to the field -
that's the part you will need to illuminate on

when you change a value - you will either need to change records, or issue
'update' command to save the changes - i suspect that because the change is
happening on a popup form, you are maybe not updating the record
 
Jethro,

I am updating the field value using RunSql update statement.

I confirmed the value is being updated in the database. If I goto the next
record by way of clicking right arrow and then come back, even then the value
doesn't get refreshed. However, if I close the form and launch it back, I see
the new value.
I can't expect users to close and reopen the form.

Users won't know if the value has changed or not when they are updating the
record and it will cause confusion, frustration.

Thank you,
-Me
 
Not sure I understand why you have a table field bound to a control in
FormA, but force changes to that field in FormB. Can you just make the
change in FormA?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Jeff,

The field in FormA is computed as a result of a field in formB. We don't
want users to enter the value, instead it is computed for eg. its just like
the
sum of value in form A - value in form B.

Then the next time a user wants to add another record, the field value in A
would be the field value in form A - field value in form B.

I hope this makes sense.

Appreciate your help!
-Me
 
I'm afraid that this is not making much sense. It sounds
like you are using formB to calculate a value that is stored
in the table used as the record source for formA. If that's
a correct interpretation, then I have some comments.

1) Unless there is an unexplained justification for it, you
should not be saving calculated values in a table. If you
would follow standard database practices and calculate the
value on the fly (probably in a query) this whole situation
would evaporate.

2) If the Requery you say you are using actually did
anything, formA would be repositioned to the first record.
Either this should have been part of your question or formA
only has one record in its dataset, which should have been
part of your problem description. All this leads me to
suspect that the Requery is not in a useful location.

3) Since formA is the form that needs to be resynchronized
with the newly saved calculated value, formB needs to
Requery formA after the Update query has completed. To know
when the query has completed, you probably need to use the
Execute method to run the query (I think(?) RunSQL runs the
query asynchronously). Then use Forms!formA.Requery.
 
Back
Top