I have one more question. How do I change event action through VBA? Let me elaborate...
When someone clicks "CUSTOMER ORDERS", the form will open with an overview of all customer's orders (continuous form). There is a button next to each record to open order details. How do I set that button's click event when I click the "CUSTOMER ORDERS" button?
EDIT:
RowSource is acting weird, see code below:
Code:
DoCmd.OpenForm "frmDEObjednavky"
Forms!frmDEObjednavky.cboFirma.RowSource = "SELECT tblFirmy.NazevFirmy, tblFirmy.PKFirmaID FROM tblFirmy WHERE tblFirmy.FKTypFirmyID = 2 ORDER BY tblFirmy.NazevFirmy;"
MsgBox Forms!frmDEObjednavky.cboFirma.RowSource
DoCmd.Close acForm, "frmDEObjednavky", acSaveYes
DoCmd.OpenForm "frmDEObjednavky"
MsgBox Forms!frmDEObjednavky.cboFirma.RowSource
DoCmd.Close acForm, "frmDEObjednavky", acSaveYes
The first MsgBox shows correct RowSource (the SQL statement), the second MsgBox is empty (as well as the actual row source, why?
Thanks again,
Tomas