Sorry Bruce, Did not mean to confuse you. Yes I do understand the implication
of using the code in the Afterupdate event . If you look at my example,
Length is stored in a Textbox control and I need to enable or disable it.
What is happening is the code works well the first time I input the length
and the lenght is disabled for subsequent entries which is great. But when I
want to enter the length for another new transaction the Length field remains
disabled.
Referring to your comment "You would need similar code in the form's Current
event" how can this be done, probably this would solve my problem.
> After Update of what to enable/disable a "field"? Of the form? A control?
> In any case, you enable/disable controls, not fields. If you are talking
[quoted text clipped - 92 lines]
> >> >
> >> > any help will be greatly appreciated.
BruceM - 13 May 2008 17:03 GMT
To place code into the form's Current event, open the form in design view.
Click View >> Properties, or use whatever other method you prefer to view
the property sheet. Click the Events tab, and click next to On Current.
Click the three dots that appear on the right side, click Code Builder, and
click OK. That should open the VBA editor with the following:
Private Sub Form_Current()
End Sub
The cursor should be blinking between those two lines. Enter the code there
(the code I suggested in an earlier post, adapted for your field and control
names). As you type it will probably give you some help. For instance,
after typing Me. you should see a list of controls, fields, and properties
that are available to the form. When you are done, click Debug >> Compile.
As I mentioned, you will need the code both in the control's After Update
event and in the form's Current event. If it is not in the After Update
event the enable/disable will not work until you move to another record.
This is because the Current event runs only when you arrive at another
record.
> Sorry Bruce, Did not mean to confuse you. Yes I do understand the
> implication
[quoted text clipped - 116 lines]
>> >> >
>> >> > any help will be greatly appreciated.