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

update a record on a form

Status
Not open for further replies.

JARE

Technical User
Jul 27, 2000
50
0
0
US
Mental block here, how do I update a record on a form?
for example, instead of scrolling up a record then
back a record just attach some code to a button to refresh.
 
In the Vb Code for a command button you would have something like:

Me.Requery

which will requery the forms records...However I'm sure using the Command button wizard, you will have a choice to create a refresh or save record button just a click away! Gord
ghubbell@total.net
 
Gord,

Based on what his original query parameters were, couldn't this requery take him off the current record? Example, original query pulled up all employees with the last name of "Smith". Then he scrolls to the certain record he wanted to change and made some changes. But then realized that he didn't want to make the changes at this time. A requery will take him back to the first record in the record set.

I think you can use the OLDVALUE to refresh it and then set the forms ISDIRTY property to false. (I think, I have not tried it). Terry M. Hoey
th3856@txmail.sbc.com
While I don't mind e-mail messages, please post all questions in these forums for the benefit of all members.
 
The code

docmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

works fine, it was generated by the command button wizard
I was just curious about the visual basic equivelent
 
Jare:
=DoCmd.RunCommand acCmdSaveRecord

Terry:
Thank you,Yes you are correct. Depending on the Record Source... I'll give your method a try and see how it goes. (I use this frequently to "bounce" the record but as you point out it may effect the position.) In any case, Jares' problem is "sol-ved"! Gord
ghubbell@total.net
 
Thanks Gord. If you try that method I mentioned, please post it anyways. Like I said, I had heard you could do that, but I haven't tried it. Like to know if it is true or not... Terry M. Hoey
th3856@txmail.sbc.com
While I don't mind e-mail messages, please post all questions in these forums for the benefit of all members.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top