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!

Subform Update problem 1

Status
Not open for further replies.

GPM4663

Technical User
Aug 9, 2001
165
GB
Hi Everyone,
I have a data capture system for a factory floor which is used to track "Make to Order" jobs and "Make to Stock Jobs". The interface is made up of a main form called "frmMainInput1" and a subform called "subFormProcesses". "subFormProcesses" is unbound until the user enters in the job number on the main form, if the number is a "Make to Order" job then the subform for that type of job is displayed and likewise for the "Make to Stock" type of job. The subform for both types of job basically displays when a job was started or stopped on a certain machine.

The problem I have is when the user clicks on a button on the main form such as "Stop Job" another form is opened asking for confirmation. If the user clicks Yes the information is added to the correct table properly but I can't get the subform to refresh and show the new information.

It will work once or twice when I'm testing it but then out on the factory floor is will not refresh unless the user clicks somewhere on the main form, then the subform again. I was using the code:
Forms!frmMainInput1.Form!subFormProcesses.Requery

after the button is clicked but it doesn't seem to work.

The user then can't see that the information has been added and then tries to add it again which causes all sorts of problems. If anyone could shed some light on this I would really appreciate it.

Many thanks

GPM
 
You may try to replace this:
Forms!frmMainInput1.Form!subFormProcesses.Requery
with this:
With Forms!frmMainInput1!subFormProcesses.Form
.RecordSource = .RecordSource
End With

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PH you are a genius! That works brilliantly!

That has been driving me mad for weeks. I'd been trying all sorts of refresh, requery and repaint to get it to work along with setting the focus from the main form to the subform and back again.

I can't thank you enough. A well earned star is a small token of gratitude!

thanks again

GPM
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top