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!

Data entered in a table behind a Subform doesn't display 1

Status
Not open for further replies.

paoconnell

Programmer
Jun 11, 2002
41
US
I'm maintaining a Access 2003 application that has two forms. Each form uses a combo box (shipment prefix) and a text box (numeric identifier) which are then concatenated to create a shipment ID. An Add button puts the shipment ID into the table behind a subform on the same form. The table is being filled correctly by the shipment ID, but the subform doesn't display the data until the subform is clicked on by a mouse.

Similarly, if the Erase button is pressed, the table is erased, but the old data persists in the subform until each row is clicked, or the form is closed.

This is a cosmetic problem (the reports print whether they appear in the subform or not), but users really don't like it when the data they've typed in doesn't show up in the subform.

Incidentally the ID field in the table behind the subform is used only to build a list of forms to be printed, and the ID field is cleared after printing.

I've researched the problem on TekTips as well as other Access websites. Many people are having this problem or similar ones, and several solutions are proposed by other programmers, but the suggestions don't seem to work. Better ideas (or a link to a fix that actually works) would be happily accepted.

Pat O'Connell
 
A simple requery / refresh of the subform doesn't work?

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Strangely enough, no; I tried a requery and a refresh. The refresh code's still there, but doesn't help. I'm suspecting that some property of the subform or the underlying table is not right. Data goes right into the table, but doesn't appear in the subform until I click on the subform. Very odd.

Pat O'Connell
 
Have you tried saving the main form record?
 
There is no main form record in this case, just the temporary records saved in the table behind the subform. The table is used to create a number of reports for printing, then the subform table is cleared.

Pat O'Connell
 
Just played with Refresh again.
'Print Ops Logs is the form with the subform
'in question:
'!!!Requery doesn't seem to work until the subform is
'clicked on:
Forms("Print Ops Logs 2").Requery

'!!!Refresh does work without clicking on the
'subform, but redraws slowly, 10-30 seconds
Forms("Print Ops Logs 2").Refresh


Why Refresh is so slow, I'm not sure.


Pat O'Connell
 
What about something like this in the main form ?
Me![name of subform control].Form.Requery

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV: this is the right direction. In a VB module, this seems to work best:

DoEvents
Forms![folder form]![Child20].Form.Refresh
'Me![Child20].Form.Requery 'your suggestion,changed to:
Forms![folder form]![Child20].Form.Requery
DoEvents


Pat O'Connell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top