Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / May 2007

Tip: Looking for answers? Try searching our database.

Edit Records

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
alex - 31 May 2007 15:03 GMT
I have a combo box on a form used to lookup records.

It seems that in order for this combo box to work, I must set Allow
Edits to Yes, making the entire form (minus locked records) editable.

I only want records to be editable, however, if the user presses a
command button.  I tried some VBA coding to modify the RecordsetType
upon a click of an 'edit button.'  This, however, didn't work well and
I figured there's a simpler way.

Thoughts?

1.    Allow a combo box to function on a form without the ability to edit/
change a record.
2.    create a command control to set allow edits to yes upon click.
3.    I'm assuming you would then add code to the AfterUpdate and
OnCurrent events setting allow edits to no.

alex
Allen Browne - 31 May 2007 15:55 GMT
Yes, if you set the form's AllowEdits to No, you can't even use the unbound
controls.

So, you need to set the Locked property of the controls instead of the
AllowEdits of the form. The code to do that is in this article:
   Locking bound controls on a form and subforms
at:
   http://allenbrowne.com/ser-56.html

The code toggles the Locked property of all controls on your form that are
bound to fields, leaving the unbound controls usable. You can specify
exceptions if there are some controls you don't want locked/unlocked. The
code also loops through any subforms it finds recursively to any depth.

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

>I have a combo box on a form used to lookup records.
>
[quoted text clipped - 15 lines]
>
> alex
alex - 31 May 2007 19:18 GMT
On May 31, 10:55 am, "Allen Browne" <AllenBro...@SeeSig.Invalid>
wrote:
> Yes, if you set the form's AllowEdits to No, you can't even use the unbound
> controls.
[quoted text clipped - 36 lines]
>
> - Show quoted text -

Thanks Allen; i'll give it a try.

alex
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.