requery

  • Thread starter Thread starter Dimitris Nikolakakis
  • Start date Start date
D

Dimitris Nikolakakis

I have a form named 'FOrders' and fields ClientID, FactoryID

I have a Combo box named Discount that takes values from table
Clientdiscounts (fields are ClientID, FactoryID, Discount)

The data of ComboBox is
SELECT Discount FROM Clientdiscounts WHERE ClientID = Forms!FOrders.ClientID
AND FactoryID = Forms!FOrders.FactoryID

My problem is that I cannot requery ther data of Discount if I change the
value of ClientID or FactoryID on the form.

I have tried in AfterUpdate of ClientID and FactoryID :
DoCmd.Requery([Combo]) but I get debug error.

thanks in advance
Dimitris
 
Hello Dimitris.

Dimitris Nikolakakis said:
I have a form named 'FOrders' and fields ClientID, FactoryID
I have a Combo box named Discount that takes values from table
Clientdiscounts (fields are ClientID, FactoryID, Discount)

The data of ComboBox is
SELECT Discount FROM Clientdiscounts WHERE ClientID =
Forms!FOrders.ClientID AND FactoryID = Forms!FOrders.FactoryID

My problem is that I cannot requery ther data of Discount if I change the
value of ClientID or FactoryID on the form.

I have tried in AfterUpdate of ClientID and FactoryID :
DoCmd.Requery([Combo]) but I get debug error.

Try DoCmd.Requery "Combo"
or Combo.Requery
 
I have tried in AfterUpdate of ClientID and FactoryID :
DoCmd.Requery([Combo]) but I get debug error.

you're using the right event (AfterUpdate). try the following code, as

Me!Discount.Requery

hth
 
Back
Top