synchronizing forms for same record and table

  • Thread starter clayton ledford
  • Start date
C

clayton ledford

I'm kind-of new with acces, so forgive me: Hopefully this is simple. I have
two forms. Form-A is set up with "allow edits" to be off, and "allow
additions" on. That way users cannot change old records by mistake, but they
can view them.

I need to add a way that a user can choose to update the old records with
some controls.

I have a button on Form-A that opens Form-B to perform an update. The forms
are nearly identical, but Form B allows edits. How do i get Form-B to
automatically show the record they were viewing in Form-A?

My goal is to lock the primary key and only let them update the other
attributes. It will close when they click a "save" command.
 
K

Klatuu

Apologies are not necessary, but I would offer a couple of comments.

Whenever possible, use one form. There really is no need to to have two
forms. You can change the Allow Edits and most other properties of a form
using VBA. Get rid of Form B. Why have to maintain the same thing twice.
Just add an Edit Record button to your form and in the click event all you
need is:
note, this also prevents the modification of the primary key control

With Me
.AllowEdits = True
.txtPrimeKey.Enabled = False
End With

Then in the Form After Update event turn it back off
With Me
.AllowEdits = False
.txtPrimeKey.Enabled = True
End With
 

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

Top