If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Error going from first field to last field in previous record
The following codes works except for when I use shift tab to go from the
first field to the last field in the previous record. The error is: Run-time error '2455': You entered an expression that has an invalid reference to the property Form/Report. The property may not exist or may not apply to the object you specified. If Nz(DVDrecID, 0) = 0 Then DVDProgListSubform.Form.AllowAdditions = False Else DVDProgListSubform.Form.AllowAdditions = True End If it's the second to last line. Thanks, J. |
#2
|
|||
|
|||
Error going from first field to last field in previous record
Hi Jason
You need to trap the error Just little thing but it's not a good idea to use the ID field for anything other than create a specific reference to a unique record. Up to you though. anyway, instead of using the ID to check if it's 0 why not just step through the reocrds available and put an erro trap in if you get to the 1st record - again, up to you. something like this would work fine on a button or change it to someother event Private Sub ButtonName_Click() On Error GoTo Err_ButtonName_Click DoCmd.GoToRecord , , acPrevious Exit_ButtonName_Click: Exit Sub Err_ButtonName_Click: MsgBox "This is the first record", vbOKOnly, "Please Stop Pressing The Button" Resume Exit_ButtonName_Click End Sub HTH -- Wayne Manchester, England. "Jason" wrote: The following codes works except for when I use shift tab to go from the first field to the last field in the previous record. The error is: Run-time error '2455': You entered an expression that has an invalid reference to the property Form/Report. The property may not exist or may not apply to the object you specified. If Nz(DVDrecID, 0) = 0 Then DVDProgListSubform.Form.AllowAdditions = False Else DVDProgListSubform.Form.AllowAdditions = True End If it's the second to last line. Thanks, J. |
#3
|
|||
|
|||
Error going from first field to last field in previous record
I don't get what you are saying
The ID is a unique identifier (autonumber). I use error trapping but is disabled while diagnosing the fault. Why stop pressing the buttons when going to a previous record should just work like pressing the back play button? I was using SHIFT-TAB not a back button. the code is in the form_on_current event. "Wayne-I-M" wrote in message news Hi Jason You need to trap the error Just little thing but it's not a good idea to use the ID field for anything other than create a specific reference to a unique record. Up to you though. anyway, instead of using the ID to check if it's 0 why not just step through the reocrds available and put an erro trap in if you get to the 1st record - again, up to you. something like this would work fine on a button or change it to someother event Private Sub ButtonName_Click() On Error GoTo Err_ButtonName_Click DoCmd.GoToRecord , , acPrevious Exit_ButtonName_Click: Exit Sub Err_ButtonName_Click: MsgBox "This is the first record", vbOKOnly, "Please Stop Pressing The Button" Resume Exit_ButtonName_Click End Sub HTH -- Wayne Manchester, England. "Jason" wrote: The following codes works except for when I use shift tab to go from the first field to the last field in the previous record. The error is: Run-time error '2455': You entered an expression that has an invalid reference to the property Form/Report. The property may not exist or may not apply to the object you specified. Form_OnCurrent If Nz(DVDrecID, 0) = 0 Then DVDProgListSubform.Form.AllowAdditions = False Else DVDProgListSubform.Form.AllowAdditions = True End If it's the second to last line. Thanks, J. |
Thread Tools | |
Display Modes | |
|
|