change a form from edit to read-only after entering data in a combo box

I have created a form that is read-only with loaded/opened. I have created a combo box that allows the user to select a record in the master database and then fills in the form.

I have been successful in getting the combo box to allow entry with allowedits=true in KEYPRESS, the form is filled in, but once I hit enter even though I have put allowedits=false in ON CLICK, ON ENTER.

Can this be done ? Have I forgotten something ?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

use the AfterUpdate event of the combobox.
one way I have done this in the past is to put the "Find" combobox in a seperate subform that is not bound and has AllowEdits= true and leave the main form AllowEdits = False. You only need to adjust your FindFirst code to reference me.Parent...

If you want to go this way please post your code and we can fix it up :-)


proffittwareAuthor Commented:
Yes, I did the subform initially and it worked they way I wanted.

I was just trying to do a one screen "Find/Search", then data entry or read-only. I have buttons ADD, EDIT, SAVE that change the read-only/data entry back and forth. But the "FIND" combo box is a problem. Do you think this can be done?

proffittwareAuthor Commented:
I tried adding to my AfterUpdate:


In my AfterUpdate event I put the above statment - after the Private statement- tested and then before the End Sub- tested and they both did not work.

I had tried this before asking for help, maybe my AfterUpdate event has a problem?

Private Sub Text1_AfterUpdate()
Me.RecordsetClone.FindFirst "[SSN]=" & "'" & Me![Text1] & "'"
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub
Private Sub Text1_AfterUpdate()
    Me.Recordset.FindFirst "[SSN]=" & "'" & Me![Text1] & "'"
    Me.AllowEdits = False
End Sub

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
proffittwareAuthor Commented:
Sorry I did not get back with you sooner...had Internet issues.

Thanks for your input !!!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.