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

refreshing values on a sending form

Status
Not open for further replies.

striker73

MIS
Jun 7, 2001
376
US
I have a form that contains a listbox. The listbox has a list of all of the invoices associated with a job. When I click on an invoice, the invoice information appears in textboxes in the bottom half of the screen.

The user can select an invoice and then click on an "Edit" button that will open up another window and allow the user to change values for that particular invoice. Once he/she is finished, the "Save Changes" button is clicked and the secondary form closes.

I want to be able to refresh the textboxes on the main form, but I can't figure out how to accomplish this. On similar form, I have it set up so that when the user clicks "Save Changes," it runs the code Forms!frmTesetReports.txtTemp.SetFocus The GotFocus() procedure for that control runs code that refreshes the textboxes. I'm not sure why this doesn't work on the invoice form. Any ideas on how this could work better? Thanks!
 
Have you tried just calling the list form's Refresh method?
Forms![List Form].Refresh
That should cause the data for the current record to be reloaded. You could call it right from the edit form's AfterUpdate event, which occurs after the record changes are saved to the database.

If the edit form allows record additions, it's more complicated than that, but you only mentioned editing the current record. Rick Sprague
 
Well, I can refresh the listbox just fine, it's just refreshing the textboxes on the form. Basically, I'd like to run my listbox_click procedure from the other form.
 
Why don't the text boxes refresh with the list box? Are they unbound???

You should be able to run the listbox_click event procedure by calling it via a custom form method. Create the following Public procedure in the list form:
Public Sub RefreshTextBoxes()
ListBox_Click
End Sub
Then call this from the edit form:
Forms![List Form].RefreshTextBoxes Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top