The expression after update you entered as the event property setting produced the following error: a problem occurred while Microsoft Office Access was communicating with the OLE server or ActiveX control
Whats happening is that i have the user click a drop down box (which is populated by a table) then choose the item and it fills in the description and price with the following vba code: (Also this is in a subform)
Expand|Select|Wrap|Line Numbers
- If (Not IsNull(Me.Part_Number) And Not IsNull(Me.Qty)) Then
- Dim rs As ADODB.Recordset
- Set rs = New ADODB.Recordset
- rs.Open "ItemMaster", CurrentProject.Connection, adOpenKeyset, adLockOptimistic, adCmdTable
- rs.MoveFirst
- rs.Find "Item='" & Me.Part_Number & "'"
- If rs.EOF = True Then GoTo Stepout
- Me.Description.Value = rs.Fields("Description").Value
- Me.Item_Cost.Value = rs.Fields("Cost").Value
- Stepout:
- rs.Close
- Set rs = Nothing
- Me.Total_Cost_of_Item = Me.Qty * Me.Item_Cost
- End If
Can i not run adodb in a subform?
Any help would be extremely appreciated!
Thanks