K
kateoc
I have a serial number which I enter on a form and it tells me 'whose
number it is'. The problem is it was set up for five digit serial
numbers and now I want to have six digits, and it won't look at the
first figure in the numbers but only five digits from the right.
What do I change in the code to get it to look at the whole six
digits.
Any ideas, thanks
Kate
Sub Issues(t)
Dim db As Database, r As Recordset, tag As String
PI = Null: RI = Null: QI = Null: PACI = Null
Set db = CurrentDb()
tag = "O" & Right(Format(100000 + t), 5)
Set r = db.OpenRecordset("SELECT [Sname] & ', ' & [Gname] AS Grower
FROM Tags INNER JOIN Grower ON Tags.GrowerID = Grower.GrowerID WHERE
Tags.TagNumber = '" & tag & "'")
If r.RecordCount > 0 Then QI = r!Grower
number it is'. The problem is it was set up for five digit serial
numbers and now I want to have six digits, and it won't look at the
first figure in the numbers but only five digits from the right.
What do I change in the code to get it to look at the whole six
digits.
Any ideas, thanks
Kate
Sub Issues(t)
Dim db As Database, r As Recordset, tag As String
PI = Null: RI = Null: QI = Null: PACI = Null
Set db = CurrentDb()
tag = "O" & Right(Format(100000 + t), 5)
Set r = db.OpenRecordset("SELECT [Sname] & ', ' & [Gname] AS Grower
FROM Tags INNER JOIN Grower ON Tags.GrowerID = Grower.GrowerID WHERE
Tags.TagNumber = '" & tag & "'")
If r.RecordCount > 0 Then QI = r!Grower