J
J A
Hello
Can somebody help me with the following:
Am using this code to fill in a Invoice form the quantities and price based
on a given serial number. Everything worked fine till now untill I splited
the database in 2; 1 for the data & the other the rest. Now after filling
the serial number, the program stops on the code marked below with 4 >.
Private Sub SerialNumber_AfterUpdate()
Dim ThisDB As Database
Dim ProdList As Recordset
Dim LookFor As String
If IsNull(Me!SerialNumber) Then
Exit Sub
DoCmd.GoToControl "Forms![Invoices]![Percent] "
End If
'If not blank, look it up.
'First define DAO object variables
Set ThisDB = CurrentDb()
Set ProdList = ThisDB.OpenRecordset("Products")
If ProdList.NoMatch Then
Beep
Else
Me![Quantity] = [ProdList]![UnitsInStock]
Me![PricePerUnit] = [ProdList]![UnitPrice]
End If
[ProdList].Close
End Sub
Thanks in advance
Can somebody help me with the following:
Am using this code to fill in a Invoice form the quantities and price based
on a given serial number. Everything worked fine till now untill I splited
the database in 2; 1 for the data & the other the rest. Now after filling
the serial number, the program stops on the code marked below with 4 >.
Private Sub SerialNumber_AfterUpdate()
Dim ThisDB As Database
Dim ProdList As Recordset
Dim LookFor As String
If IsNull(Me!SerialNumber) Then
Exit Sub
DoCmd.GoToControl "Forms![Invoices]![Percent] "
End If
'If not blank, look it up.
'First define DAO object variables
Set ThisDB = CurrentDb()
Set ProdList = ThisDB.OpenRecordset("Products")
ProdList.Index = "PrimaryKey" LookFor = Me![SerialNumber]
ProdList.Seek "=", LookFor
If ProdList.NoMatch Then
Beep
Else
Me![Quantity] = [ProdList]![UnitsInStock]
Me![PricePerUnit] = [ProdList]![UnitPrice]
End If
[ProdList].Close
End Sub
Thanks in advance