H
hollyylloh
I have been stairing at this for awhile and don't see the problem. I hope you
can help. I added all the msgboxs just to narrow the error down.
I have the following code:
Private Sub Form_Current()
'the form checks the subform to see if there are any records present.
With Me![qryNewCompanyNameIsLike subform].Form
If .RecordsetClone.RecordCount = 0 Then
'if no records are present in the subform, it pastes the record into a table
named tblToExport
MsgBox "is Null"
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
MsgBox "copied"
DoCmd.OpenTable "tblToExport"
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdPaste
DoCmd.GoToRecord , , acNext
MsgBox "go to next tblToExport record"
DoCmd.OpenForm "frmImportedIsLike"
MsgBox "pasted and back"
DoCmd.GoToControl "Company"
MsgBox "go to company"
DoCmd.GoToRecord , , acNext
MsgBox "go to next"
-------I get the error here----"You can't go the the specified record." I
get this error after it goes to the next record.
End If
End With
End sub
can help. I added all the msgboxs just to narrow the error down.
I have the following code:
Private Sub Form_Current()
'the form checks the subform to see if there are any records present.
With Me![qryNewCompanyNameIsLike subform].Form
If .RecordsetClone.RecordCount = 0 Then
'if no records are present in the subform, it pastes the record into a table
named tblToExport
MsgBox "is Null"
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
MsgBox "copied"
DoCmd.OpenTable "tblToExport"
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdPaste
DoCmd.GoToRecord , , acNext
MsgBox "go to next tblToExport record"
DoCmd.OpenForm "frmImportedIsLike"
MsgBox "pasted and back"
DoCmd.GoToControl "Company"
MsgBox "go to company"
DoCmd.GoToRecord , , acNext
MsgBox "go to next"
-------I get the error here----"You can't go the the specified record." I
get this error after it goes to the next record.
End If
End With
End sub