angelandgreg
Technical User
I have all ready an AfterUpdate Event Procedure and would like to add to it.
Not sure how to do this ...
Basically the 2nd function I need the AfterUpdate to do is after selecting the ItemNumber it needs to update another field of the dollar amount for the ItemNumber.
Currently on the ItemNumber field I have an AfterUpdate as such:
Private Sub Item_AfterUpdate()
Dim db As DAO.Database, rst As DAO.Recordset, SQL As String
If Me.NewRecord Then
Set db = CurrentDb
SQL = "SELECT TOP 1 LineItem " & _
"FROM CustomQuoteDetails " & _
"WHERE ([QuoteID] = " & Me.QuoteID & ") " & _
"ORDER BY LineItem DESC;"
Set rst = db.OpenRecordset(SQL, dbOpenDynaset)
If rst.BOF Then 'Unique QuoteID
Me!LineItem = 1
Else 'Quote ID Exists
Me!LineItem = rst!LineItem + 1
End If
End If
' Me![ItemNumber] = Me![FIN1000].Column 2 <-- where to add this so it'll work with the rest of the code?
Set rst = Nothing
Set db = Nothing
End Sub
and I want to also have it do update the FIN1000 field with data when the specific ItemNumber is selected in the ItemNumber field.
something like this and where in the current code can it be added and how?
Me![ItemNumber] = Me![FIN1000].Column 2
the combo box on ItemNumber field has:
ItemNumber ItemDesc FIN1000
Not sure how to do this ...
Basically the 2nd function I need the AfterUpdate to do is after selecting the ItemNumber it needs to update another field of the dollar amount for the ItemNumber.
Currently on the ItemNumber field I have an AfterUpdate as such:
Private Sub Item_AfterUpdate()
Dim db As DAO.Database, rst As DAO.Recordset, SQL As String
If Me.NewRecord Then
Set db = CurrentDb
SQL = "SELECT TOP 1 LineItem " & _
"FROM CustomQuoteDetails " & _
"WHERE ([QuoteID] = " & Me.QuoteID & ") " & _
"ORDER BY LineItem DESC;"
Set rst = db.OpenRecordset(SQL, dbOpenDynaset)
If rst.BOF Then 'Unique QuoteID
Me!LineItem = 1
Else 'Quote ID Exists
Me!LineItem = rst!LineItem + 1
End If
End If
' Me![ItemNumber] = Me![FIN1000].Column 2 <-- where to add this so it'll work with the rest of the code?
Set rst = Nothing
Set db = Nothing
End Sub
and I want to also have it do update the FIN1000 field with data when the specific ItemNumber is selected in the ItemNumber field.
something like this and where in the current code can it be added and how?
Me![ItemNumber] = Me![FIN1000].Column 2
the combo box on ItemNumber field has:
ItemNumber ItemDesc FIN1000