snoopy80
Technical User
- Jun 27, 2001
- 106
I Keep having this error when I click on Newrecord button in my Access ADP form. "Object Variable or Block Variable Not Set". Could someone give me an advise, please. This is my code:
On Error GoTo Err_CMDNEW_Click
DoCmd.GoToRecord , , acNewRec
Dim dbs As Object
Dim qdf As Object
Set dbs = CurrentDb
dbs.QueryDefs.Refresh
Me.Refresh
If IsNull(Forms!frmaccount!!subfrmOrder!DOS) = False Then
Forms!frmaccount!!subfrmOrder!Cost = Forms!frmaccount!subfrmOrder!subfrmcost!total
End If
Exit_CMDNEW_Click:
Exit Sub
Err_CMDNEW_Click:
MsgBox Err.Description
Resume Exit_CMDNEW_Click
Appreciate your help and Happy THANKSGIVING
On Error GoTo Err_CMDNEW_Click
DoCmd.GoToRecord , , acNewRec
Dim dbs As Object
Dim qdf As Object
Set dbs = CurrentDb
dbs.QueryDefs.Refresh
Me.Refresh
If IsNull(Forms!frmaccount!!subfrmOrder!DOS) = False Then
Forms!frmaccount!!subfrmOrder!Cost = Forms!frmaccount!subfrmOrder!subfrmcost!total
End If
Exit_CMDNEW_Click:
Exit Sub
Err_CMDNEW_Click:
MsgBox Err.Description
Resume Exit_CMDNEW_Click
Appreciate your help and Happy THANKSGIVING