Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refreshing MS Access forms

Status
Not open for further replies.

Danielbryanuk

Technical User
Sep 26, 2007
48
DE
Hi there,

I am building a database and have a query about refreshing data in a form.

The form is based on a table (say TBLX), and has only one control which is a field from the source table (say DATAX). The data in this field is the same for all records in TBLX, so I decided to base the form on the table rather than creating a query for it.

I run a number of macros from the form using other command buttons. One particular macro updates all the data in TBLX, by way of deleting all the table contents first, then appending new data from a holding table. I chose this method instead of importing directly to TBLX as I didn’t know how to overwrite data using the 'get external data' menu function, or the 'transfer...' macro action. Either way I figured I would have to delete TBLX before updating it.

The problem is that after updating TBLX the form control that is meant to display DATAX only shows “#Deleted”. I have tried running a ‘requery’ and ‘repaint’ as part of the macro (after the new data is appended), and have tried using a ‘refresh’ control on the form itself (using the command button wizard). Each method fails to update the control. The control is updated when you close and open the form, but I don't want to do this.

It is important to refresh the control as it is referenced in the next macro I use (it is part of a condition on the macro to control the flow etc.) In this case the evaluation of the condition is incorrect.

What do you think the problem is?

Many thanks for your help.

Dan
 
I recommend you convert your macro to VBA and post in either forum702 or in forum705 complete with your VBA code.

If you link the thread here it will help others and myself find it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top