![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi Can anybody tell me why the VBA code below works fine in Access 2003 but doesn't work in Access 2007? I do not get any error message, even if I put a deliberate error into the code. Also, if I put a debug break point in the code, nothing happens. If I add the line msgbox "ok" it displays the message box, so I know that it is reading the code. This is a frightening problem, because if this doesn't display errors, then what other bits of code are not working? This is happening on every PC which has Access 2007. Here's what should happen - when the user clicks on a list box, it takes the value from the item he has clicked on and goes off and finds the record which corresponds with the value. Private Sub lstCompany_Click() On Error GoTo err_handler DoCmd.GoToRecord acActiveDataObject, , acFirst txtNAME.Locked = False txtNAME.SetFocus DoCmd.FindRecord lstCompany.Column(0), acAnywhere, False, , False, acCurrent, False txtFindCompany.SetFocus txtNAME.Locked = True txtFindCompany.SetFocus Exit Sub err_handler: MsgBox Err.Number & " " & Err.Description Exit Sub End Sub Thanks a lot for any help Colin |
#3
| |||
| |||
|
|
I'm not sure why that would cause an error, however, you can check your vba settings to help find the error message. Open your code module, then in vba, click on tools, options. Verify that error handling is set to "break on all errors". Recompile, and then when you run you should at least get an error number / description. Hope this helps, |
#4
| |||
| |||
|
|
On 6 Mar, 15:00, "ARC" <PCES... (AT) PCESoft (DOT) invalid> wrote: I'm not sure why that would cause an error, however, you can check your vba settings to help find the error message. Open your code module, then in vba, click on tools, options. Verify that error handling is set to "break on all errors". Recompile, and then when you run you should at least get an error number / description. Hope this helps, I've just followed your advice. Unfortunately even with "break on all errors" set, I still don't get an error from the code. Colin |
#5
| |||
| |||
|
#6
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |