M
mattc66 via AccessMonster.com
I had this look up working great and now it's not working. Not sure what
changed in my code.
It seems to be failing at the stLink = "[RGAID]=" & SID
The RGAID is a number feild. So I am wondering if I have to change the AS
String to AS Integer. I am getting an error TYPE MISS MATCH 13. I tried it
with AS Integer and it still error's out.
Private Sub Combo41_AfterUpdate()
On Error GoTo ErrorHandler
' Find the record that matches the control.
Dim SID As String
Dim stLink As String
Dim rsc As DAO.Recordset
Set rsc = Me.RecordsetClone
SID = Me.Combo41.Value
stLink = "[RGAID]=" & SID
'Check table for for item number.
If DCount("RGAID", "qryRGASource", stLink) >= 1 Then
'Go to record of original Number
rsc.FindFirst stLink
Me.Bookmark = rsc.Bookmark
Else
'Message box warning that item doesn't exsist.
MsgBox "Warning RGA " _
& SID & " is not a valid RGA." _
& vbCr & vbCr & "Call someone who cares.", vbExclamation _
, "RGA NOT FOUND"
End If
Set rsc = Nothing
ErrorHandler:
MsgBox "Error#: " & Err.Number & vbCrLf & Err.DESCRIPTION
End Sub
changed in my code.
It seems to be failing at the stLink = "[RGAID]=" & SID
The RGAID is a number feild. So I am wondering if I have to change the AS
String to AS Integer. I am getting an error TYPE MISS MATCH 13. I tried it
with AS Integer and it still error's out.
Private Sub Combo41_AfterUpdate()
On Error GoTo ErrorHandler
' Find the record that matches the control.
Dim SID As String
Dim stLink As String
Dim rsc As DAO.Recordset
Set rsc = Me.RecordsetClone
SID = Me.Combo41.Value
stLink = "[RGAID]=" & SID
'Check table for for item number.
If DCount("RGAID", "qryRGASource", stLink) >= 1 Then
'Go to record of original Number
rsc.FindFirst stLink
Me.Bookmark = rsc.Bookmark
Else
'Message box warning that item doesn't exsist.
MsgBox "Warning RGA " _
& SID & " is not a valid RGA." _
& vbCr & vbCr & "Call someone who cares.", vbExclamation _
, "RGA NOT FOUND"
End If
Set rsc = Nothing
ErrorHandler:
MsgBox "Error#: " & Err.Number & vbCrLf & Err.DESCRIPTION
End Sub