record locking

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

Guest

I have a main fomr with subforms.

i need to edit records for one of the sub forms, so i close the main form,
open the edit form, do my work, close the edit form and reopen the main form
(this is to update the data on the subform)

what is happening is that wheni go back to the main form aftter editing and
try to edit another part of the form i am giving a message saying that the
record is locked by another user.

i believe that when closing the form something is not closing the record
properly.

can anyone please help me.

thanks

richard
 
it might be easier to open the Edit form without closing the main form. in
the Edit form's Close event, run code that requeries the subform on the main
form, as

Forms!MainFormName!SubformControlName.Form.Requery

substitute the correct form and control names of course, and make sure that
you use the name of the subform control (within the main form) that "holds"
the subform - not the name of the subform as it appears in the database
window. sometimes those two names are the same, but sometimes not.

hth
 
hi tina,

thanks for this. i found out that it was a line of code i had put (on close
event of the subform) in to enter a date in another subform on the main form
was causing the issue.

i got around this by having the subform which was to receive the date, open,
receive the date and close in the background. a bit crude but the user does
not see it and works well.

i will try your method to see if that stops me form neeidng to do the above.

thansk

richard
 
you're welcome, glad you found something that works for you. :)
btw, a subform is specifically a form nested inside another form. when you
open a form in a separate window, it is not a subform. i'm not being
nitpicky; when using the term subform, it refers to a specific type of
object that has specific properties and behaviors, and is manipulated in
specific ways - that are different from forms. when discussing issues with
other Access developers, it's important to use the correct terminology, so
as not to cause confusion and frustration all around.

hth
 

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