form editing

B

bleep

I've got a text box linked to a combo box on a form. When i Click th
combo box the text box value changes. I've got the form locked so tha
existing records cant be edited but new ones can be added. My proble
is when i click the combo box to select a value the text box update
but as soon as it updates the form locks up so that i cant finis
adding information. Does anyone know of a way i could fix this please
any help would be appreciated. The code used in the combo box to updat
the text box is listed below....

Private Sub ActName_AfterUpdate()
[Department] = Me.ActName.Column(2)
Me.Refresh
End Sub

Thanks
Fay
 
M

Marshall Barton

bleep said:
I've got a text box linked to a combo box on a form. When i Click the
combo box the text box value changes. I've got the form locked so that
existing records cant be edited but new ones can be added. My problem
is when i click the combo box to select a value the text box updates
but as soon as it updates the form locks up so that i cant finish
adding information. Does anyone know of a way i could fix this please?
any help would be appreciated. The code used in the combo box to update
the text box is listed below....

Private Sub ActName_AfterUpdate()
[Department] = Me.ActName.Column(2)
Me.Refresh
End Sub


Remove the Me.Refresh, it save changes to the current record
so it's not a new record anymore.
 
B

Bill

Use a variable to store the Me.NewRecord value with the current event of the
form. So that even when any changes are saved and the newrecord property is
set to false, thus not allowing edits you will use the stored value instead.
Now use this variable to set the Me.AllowEdits property of the form.
Understand?
HTH
Bill
 

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