Enabling Properties

M

Marat Mamedov

I am currently creating a data entry form in Access, and
would like to do the following.

I was to either lock or disable everything on the form,
however, when the user clicks on add new, everything
either ungrays or becomes enabled. I am almost positive
that this can be done, and would love to know if there is
a specific macro/expression/or code that is needed for
this little neusense.

Any help would be greatly appreciated.

Thank you,

Marat Mamedov
 
M

Marat Mamedov

The following is the code for my add new button:


Private Sub New_Mistake_Click()
On Error GoTo Err_New_Mistake_Click


DoCmd.GoToRecord , , acNewRec
DoCmd.DoMenuItem acFormBar, acRecordsMenu,
acSaveRecord, , acMenuVer70

Exit_New_Mistake_Click:
Exit Sub

Err_New_Mistake_Click:
MsgBox Err.Description
Resume Exit_New_Mistake_Click

End Sub
 
L

Lynn Trapp

You will need to set the Enabled property of each of your controls to NO in
the form property sheet and add the following code to your new button:

Me.txtYourFirstTextbox.Enabled = True

Repeat that for all the controls on the form that you want to be editable.
You will then need to set the enabled property to false somewhere else -
probably in the AfterUpdate event or Current event of the form.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
 

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