M
mattc66 via AccessMonster.com
I am getting the following error when I run this code and the has a letter in
the value. Does anyone have a suggestion as to why?
Run-time error '3075';
Syntax error (missing operator) in query epression
'ItemParent=9804-025 V1'.
----------------------Code-----------------------------
Private Sub LookUpBomItem_AfterUpdate()
Dim SID As String
Dim rsc As DAO.Recordset
Dim db As Database
Set rsc = Me.RecordsetClone
Set db = CurrentDb
SID = "ItemParent=" & Me.LookUpBomItem.Value
'Record not found add record
DoCmd.GoToRecord , , acNewRec
Me.ItemParent = Me.LookUpBomItem.Column(0)
Me.DESCRIPTION = Me.LookUpBomItem.Column(1)
Me.Beg_Date = Me.LookUpBomItem.Column(2)
Me.End_Date = Me.LookUpBomItem.Column(3)
Me.Version = Me.LookUpBomItem.Column(4)
Me.ImagePath = Me.LookUpBomItem.Column(5)
Me.ItemCompID = Me.LookUpBomItem.Column(6)
ElseIf DCount("ItemParent", "tblItemParent", SID) >= 1 Then
'Go to record of original Number
rsc.FindFirst SID
Me.Bookmark = rsc.Bookmark
End If
Set rsc = Nothing
End Sub
the value. Does anyone have a suggestion as to why?
Run-time error '3075';
Syntax error (missing operator) in query epression
'ItemParent=9804-025 V1'.
----------------------Code-----------------------------
Private Sub LookUpBomItem_AfterUpdate()
Dim SID As String
Dim rsc As DAO.Recordset
Dim db As Database
Set rsc = Me.RecordsetClone
Set db = CurrentDb
SID = "ItemParent=" & Me.LookUpBomItem.Value
'Record not found add record
DoCmd.GoToRecord , , acNewRec
Me.ItemParent = Me.LookUpBomItem.Column(0)
Me.DESCRIPTION = Me.LookUpBomItem.Column(1)
Me.Beg_Date = Me.LookUpBomItem.Column(2)
Me.End_Date = Me.LookUpBomItem.Column(3)
Me.Version = Me.LookUpBomItem.Column(4)
Me.ImagePath = Me.LookUpBomItem.Column(5)
Me.ItemCompID = Me.LookUpBomItem.Column(6)
ElseIf DCount("ItemParent", "tblItemParent", SID) >= 1 Then
'Go to record of original Number
rsc.FindFirst SID
Me.Bookmark = rsc.Bookmark
End If
Set rsc = Nothing
End Sub