N
NeedHlp
I have created a form so I can scan bar code labels to check inventory. I
open the form with the focus in the text box and I scan my first item. If it
find it in the table it will pull some additional information but I want the
focus to stay in the text box and highlight the data so I can scan my next
item. But I can not get it to hightlight the data in the text box. I am
using the following code:
strBarCode = Me.BarcodeNumber.Value
strSQL = "BarcodeNumber" & " = " & Me("BarcodeNumber") '& Chr(34)Chr(34) &
intID = Me.BarcodeNumber.Value
strString = "SELECT PB_Line.Full_LIN, PB_Line.LIN, PB_Line.[Generic
Nomenclature], PB_Line.Auth, PB_Detail.[Stock Number], PB_Detail.[NSN
Nomenclature], PB_Detail.OnHand, PB_SubDetail.SN, PB_SubDetail.SN_Owner,
PB_SubDetail.Location, PB_SubDetail.BarcodeNumber, Department.Department,
Employees.FirstName, Employees.LastName, [Asset Categories].AssetCategory,
Status.Status " & _
"FROM Status RIGHT JOIN ([Asset Categories] RIGHT JOIN
((Department RIGHT JOIN ((PB_Line INNER JOIN PB_Detail ON PB_Line.Full_LIN =
PB_Detail.Full_LIN) INNER JOIN PB_SubDetail ON (PB_Detail.[Stock Number] =
PB_SubDetail.[Stock Number]) AND (PB_Line.Full_LIN = PB_SubDetail.Full_LIN))
ON Department.DepartmentID = PB_SubDetail.Department) LEFT JOIN Employees ON
PB_SubDetail.SN_Owner = Employees.EmployeeNumber) ON [Asset
Categories].AssetCategoryID = PB_SubDetail.AssetCategoryID) ON
Status.StatusID = PB_SubDetail.StatusID " & _
"WHERE (((PB_SubDetail.BarcodeNumber)=" & intID & "));"
Set rs = CurrentDb.OpenRecordset(strString)
If rs.BOF Or rs.EOF Then
Clear_Data
MsgBox ("No data in Database")
Me.BarcodeNumber.SelStart = 0
Me.BarcodeNumber.SelLength = Len(Me.BarcodeNumber.Text)
Else
Pull_Data
Me.Employee = sName
Me.DepartmentID = sDepartment
Me.SNOwner = sOwner
Me.txtLIN = sLIN
Me.AssetDescription = sGeneric
Me.Auth = sAuth
Me.StockNo = sStock
Me.NSN = sNSN
Me.OnHand = sOnHand
End If
Can anyone help!!!!!
open the form with the focus in the text box and I scan my first item. If it
find it in the table it will pull some additional information but I want the
focus to stay in the text box and highlight the data so I can scan my next
item. But I can not get it to hightlight the data in the text box. I am
using the following code:
strBarCode = Me.BarcodeNumber.Value
strSQL = "BarcodeNumber" & " = " & Me("BarcodeNumber") '& Chr(34)Chr(34) &
intID = Me.BarcodeNumber.Value
strString = "SELECT PB_Line.Full_LIN, PB_Line.LIN, PB_Line.[Generic
Nomenclature], PB_Line.Auth, PB_Detail.[Stock Number], PB_Detail.[NSN
Nomenclature], PB_Detail.OnHand, PB_SubDetail.SN, PB_SubDetail.SN_Owner,
PB_SubDetail.Location, PB_SubDetail.BarcodeNumber, Department.Department,
Employees.FirstName, Employees.LastName, [Asset Categories].AssetCategory,
Status.Status " & _
"FROM Status RIGHT JOIN ([Asset Categories] RIGHT JOIN
((Department RIGHT JOIN ((PB_Line INNER JOIN PB_Detail ON PB_Line.Full_LIN =
PB_Detail.Full_LIN) INNER JOIN PB_SubDetail ON (PB_Detail.[Stock Number] =
PB_SubDetail.[Stock Number]) AND (PB_Line.Full_LIN = PB_SubDetail.Full_LIN))
ON Department.DepartmentID = PB_SubDetail.Department) LEFT JOIN Employees ON
PB_SubDetail.SN_Owner = Employees.EmployeeNumber) ON [Asset
Categories].AssetCategoryID = PB_SubDetail.AssetCategoryID) ON
Status.StatusID = PB_SubDetail.StatusID " & _
"WHERE (((PB_SubDetail.BarcodeNumber)=" & intID & "));"
Set rs = CurrentDb.OpenRecordset(strString)
If rs.BOF Or rs.EOF Then
Clear_Data
MsgBox ("No data in Database")
Me.BarcodeNumber.SelStart = 0
Me.BarcodeNumber.SelLength = Len(Me.BarcodeNumber.Text)
Else
Pull_Data
Me.Employee = sName
Me.DepartmentID = sDepartment
Me.SNOwner = sOwner
Me.txtLIN = sLIN
Me.AssetDescription = sGeneric
Me.Auth = sAuth
Me.StockNo = sStock
Me.NSN = sNSN
Me.OnHand = sOnHand
End If
Can anyone help!!!!!