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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to force a switchboard to refresh when closing another form? 1

Status
Not open for further replies.

telephoto

Technical User
Nov 3, 2002
210
GB
I have two tables, tblCustomers and tblMachines, now all machines should belong to a customer (foreign key), but due to a table design oversight some machines are orphans.

In order for my client to find these I have inserted a routine at the switchboard "form current" event to check for orphans, and count them, this total is then shown on a label caption with a command button.

The command button opens a form to show an orphan machine record, and also customers with the same address, the client selects the correct customer and the record is corrected.

When the orphan form is closed the switchboard reappears, but the total number of orphans is unchanged unless the form is manually closed and reopened.

I have tried to refresh/requery immediately before docmd.close on the orphan form, but without success.

Should I put the routine in a different form action? or is there a proper/different way?

Telephoto
(Sometimes I feel I'm getting too old for all this...)
 
You could try Recalc the specific control on the switchboard in the On Activate event.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
Hi Duane, again!

Many thanks, I just copied and pasted everything from Current into On Activate and it works like a charm.

Graham
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top