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

Editing records

Status
Not open for further replies.

rookery

Programmer
Apr 4, 2002
384
GB
Hi guys

i'm trying to set up an Edit faciltiy on a Bound Form. I have created the button with the following code:

Private Sub cmdEdit_Click()
Me.AllowEdits = True
Me![Title].SetFocus

End Sub

which allows me to Edit the current record. All well and good except when I move to the next record the AllowEdits property is still true when I dont necessarily want it to be. I'm sure it's something simple. Is this the most efficient way of doing it?
 
If you are using custom cmdButtons to move from record to record, you could simply add Me.AllowEdits = False to the code.

If not, create a custom button to move from record to record and include the above code.

Hope this helps. %-)

Robert L. Johnson III, A+, Network+
robert.l.johnson.iii@citi.com
Access Database Designer/Administrator
 
Rob

Thanks for your reply but I dont think I explained myself well enough. Basically I'm using the navigation buttons on the bound Form to go backwards/forwards etc. I dont want to create buttons to navigate the records. Also, I have created a button which I have then tried to write Edit code behind. I want to get to a point where by clicking this will enable me to Edit the current record but then "switch off" again when I move to the next\previous record. I'm sure this can be done. Any ideas?
Cheers.
 
Checking my resource files.....I think you could still try the previous code I gave, Me.AllowEdits = False , in the OnCurrent property of your form. This property is checked every time you move from record to record. I think this will work without creating any custom buttons, but alas, I have not tried it yet. Let me know if it does. ;-) Robert L. Johnson III, A+, Network+
robert.l.johnson.iii@citi.com
Access Database Designer/Administrator
 
Hi Rob

I was just logging on to let you know that putting your code into the OnCurrent property works when you beat me to it....

And yes, you'll be pleased to know that it works fine!! It seems like a much easier way of doing it rather than creating Recordsets etc.

Thanks again mate.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top