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

Refreshing a Columnar Form after adding a new record

Status
Not open for further replies.

DirkGently

Programmer
May 25, 2000
3
US
I have a form that lists all the records in a table. You cannot add a new record on this form, you must click the "add record" button, which opens the edit form allowing the creation of a new record. After creating the record and closing the entry form, how can I get the form with the list of all records to refresh so that the new record shows in the list? I tried adding a "Refresh" button to the form, (using the wizard) but it does not make the new record show up in the list. The new record shows only if I close the form and re-open it.

Any help would be greatly appeciated.
 
In the Close event of the Edit Form:

Forms![ViewFormName].Requery

Hope this helps!

Anthony J. DeSalvo
President - ScottTech Software
"Integrating Technology with Business"
 
Have to buttons on your form Add Record and Return(or Close or Save).
Go to the property sheet of the Add Record button, click on the OnClick event and type:

DataEntry = True
AllowAdditions = True
AllowEdits = True
AllowDeletions = True
[TheFirstControlName].SetFocus

On the other buttons OnClick event type:

DataEntry = False
AllowAdditions = False
AllowEdits = False
AllowDeletions = False

So the first sets your form to just edit mode and the other sets it back to just info mode and updates the records.

Neil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top