J
Joan
Hi,
I have a form called "SalesScreen" where on the AfterUpdate event of the
[Store] control I have the following code:
Private Sub Store_AfterUpdate()
Dim db As Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("EnterStoresQuery", dbOpenDynaset)
If Forms!SalesScreen!Returned = "Y" And Forms!SalesScreen![Store] Is Not
Null Then
Forms!SalesScreen!ReturnedStore = Forms!SalesScreen!Store
Forms!SalesScreen!ReturnedSalePrice = Forms!SalesScreen!SalesPrice
End If
rs.Close
db.Close
End Sub
When I update the [Store] field and press tab, I get the followin runtime
error: "Object required". What object am I missing?
This form (displays inventory of dogs) is used by salesmen to record the
storecode in the [Store] field of a dog record when they sell a dog to a
store. Sometimes dogs are returned from stores for one reason or another,
put back into inventory and resold. When a dog is returned, the dog record
again appears on the SalesScreen with the [Store] control blank so that the
saleman can enter the storecode again when the dog is resold. Behind the
scenes, unbeknown to the salesmen, fields need to be updated such as:
ReturnedStore(store the dog is sold to the second time) and
ReturnedSalesPrice (Price the dog is sold at the second time around). These
controls are on the SalesScreen form but are invisible to the user. This
essentially is what I am trying to do with the above code. What am I doing
wrong? Any suggestions are appreciated.
Joan
I have a form called "SalesScreen" where on the AfterUpdate event of the
[Store] control I have the following code:
Private Sub Store_AfterUpdate()
Dim db As Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("EnterStoresQuery", dbOpenDynaset)
If Forms!SalesScreen!Returned = "Y" And Forms!SalesScreen![Store] Is Not
Null Then
Forms!SalesScreen!ReturnedStore = Forms!SalesScreen!Store
Forms!SalesScreen!ReturnedSalePrice = Forms!SalesScreen!SalesPrice
End If
rs.Close
db.Close
End Sub
When I update the [Store] field and press tab, I get the followin runtime
error: "Object required". What object am I missing?
This form (displays inventory of dogs) is used by salesmen to record the
storecode in the [Store] field of a dog record when they sell a dog to a
store. Sometimes dogs are returned from stores for one reason or another,
put back into inventory and resold. When a dog is returned, the dog record
again appears on the SalesScreen with the [Store] control blank so that the
saleman can enter the storecode again when the dog is resold. Behind the
scenes, unbeknown to the salesmen, fields need to be updated such as:
ReturnedStore(store the dog is sold to the second time) and
ReturnedSalesPrice (Price the dog is sold at the second time around). These
controls are on the SalesScreen form but are invisible to the user. This
essentially is what I am trying to do with the above code. What am I doing
wrong? Any suggestions are appreciated.
Joan