Updating a table after closing a form.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to update a table in a database I am creating. When a user doesn't
find the name in a lookup combo box, they click a command button and another
form appears to allow them to add a new account. Once the second box is
closed I need to update the table they just entered the account so it can be
added to the job. I thought that I would use the Me.Refesh in the code window
under the On Close, but that didn't work. Any assistance would be greatly
appreciated. If you can't already tell Access is not really my forte.
 
Try and use requery instead of refresh, on the unload event of the second
form enter the code

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Forms![FirstFormName]![ComboName].requery
 
This command for the requery looks as though it only updates one object,
multiple objects are added with the form that opens from the command button.
Can I do Tables![FirstTableName].requery ?

Ofer said:
Try and use requery instead of refresh, on the unload event of the second
form enter the code

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Forms![FirstFormName]![ComboName].requery
--
In God We Trust - Everything Else We Test


Frank said:
I need to update a table in a database I am creating. When a user doesn't
find the name in a lookup combo box, they click a command button and another
form appears to allow them to add a new account. Once the second box is
closed I need to update the table they just entered the account so it can be
added to the job. I thought that I would use the Me.Refesh in the code window
under the On Close, but that didn't work. Any assistance would be greatly
appreciated. If you can't already tell Access is not really my forte.
 
After performing a requery on the combo box, will allow the user to select
the name he couldn't find before, and to select it.
--
In God We Trust - Everything Else We Test


Frank said:
This command for the requery looks as though it only updates one object,
multiple objects are added with the form that opens from the command button.
Can I do Tables![FirstTableName].requery ?

Ofer said:
Try and use requery instead of refresh, on the unload event of the second
form enter the code

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Forms![FirstFormName]![ComboName].requery
--
In God We Trust - Everything Else We Test


Frank said:
I need to update a table in a database I am creating. When a user doesn't
find the name in a lookup combo box, they click a command button and another
form appears to allow them to add a new account. Once the second box is
closed I need to update the table they just entered the account so it can be
added to the job. I thought that I would use the Me.Refesh in the code window
under the On Close, but that didn't work. Any assistance would be greatly
appreciated. If you can't already tell Access is not really my forte.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top