I have the property of limit to list to 'Yes' however if the user enters an
incorrect code the message regarding not in the list is displayed followed by
the error message 'microsoft access cannot find the macro 33023'. I do not
have any macro attached to this control. Could anyone please help me solve
this problem, many thanks Sue.
> I have a combo box on a form which is linked to a table created to populate
> the list once all the data is entered all the data is then saved in another
> table. What I need is for the user not to be able to enter any data into
> this field only to select from the list. Many thanks for your assistance.
You could just change it to a list box. But if you really want to do it with
a combo box ...
Private Sub ReportsTo_KeyPress(KeyAscii As Integer)
If KeyAscii <> vbKeyEscape And KeyAscii <> vbKeyTab And KeyAscii <>
vbKeyReturn Then
KeyAscii = 0
End If
End Sub

Signature
Brendan Reynolds
Access MVP
>I have a combo box on a form which is linked to a table created to populate
> the list once all the data is entered all the data is then saved in
> another
> table. What I need is for the user not to be able to enter any data into
> this field only to select from the list. Many thanks for your assistance.
Sue Wilkes - 28 Nov 2006 12:35 GMT
Brendan, Thank you for the code, could you please tell me where I should
insert it (I tried using it on the events 'got focus' and 'on click' but I'm
still getting the error message). Regards Sue
> You could just change it to a list box. But if you really want to do it with
> a combo box ...
[quoted text clipped - 13 lines]
> > table. What I need is for the user not to be able to enter any data into
> > this field only to select from the list. Many thanks for your assistance.
Douglas J. Steele - 28 Nov 2006 13:10 GMT
Brendan's code tells you where to put it: in the KeyPress event.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> Brendan, Thank you for the code, could you please tell me where I should
> insert it (I tried using it on the events 'got focus' and 'on click' but
[quoted text clipped - 22 lines]
>> > this field only to select from the list. Many thanks for your
>> > assistance.
Sue Wilkes - 28 Nov 2006 13:30 GMT
Thank you Douglas, I feel such a nerd now but it works great, Sue
> Brendan's code tells you where to put it: in the KeyPress event.
>
[quoted text clipped - 24 lines]
> >> > this field only to select from the list. Many thanks for your
> >> > assistance.