DynamicComponents Binding Recordset Features
Few Lines to add in your Form_Load event and you will get full control over your form and all included (TextBox - Lables-Buttons-Grid-Recordset) and all related events (Leave-paint-Keypress-AfterColEdit-OnAddNew-Click-MouseEnter-MouseLeave-MouseDown-Enter)
You can:
- Navigate first ,previous , next and last
- Add new records ,edit it ,save it , or delete it
- Set relation between master and details files
- Retrieve related names to your fields code
- search data for specific formula
- Trigger sensitive DataHelp to select from by pressing F1
- Define required Fields to accept input
- Populate your form with data automatically after focus change
Note: if you develop multi language application or eastern language application , it is recommended to use both of DC.FormTranslator and DC.FormFlipper
Example:
Dim BR As New DynamicComponents.BindingRecordset()
'establish DSN
oAccess.DBEngine.RegisterDatabase("DCDM_Nwind", "Microsoft Access Driver (*.mdb)", True, "DBQ=" & VB6.GetPath & "\Nwind.mdb")
CN.Open("DSN=DCDM_NWind")
oOrders.Open("Orders", CN, oOrders.CursorType.adOpenKeyset, oOrders.LockType.adLockOptimistic)
oOrderDetails.Open("OrderDetails", CN, oOrderDetails.CursorType.adOpenKeyset, oOrderDetails.LockType.adLockOptimistic)
Me.AxDataGrid1.DataSource = oOrderDetails
BR.InitForm(CN, Me, oOrders, AxDataGrid1, oOrderDetails) 'Must Be your first declaration
BR.NavigationButtons("FirstButton", "PrevButton", "NextButton", "LastButton")
BR.ManipulationButtons("OkButton", "NewButton", "DeleteButton", "ExitButton", "SearchButton")
BR.KeyFields("OrderId")
BR.SetLink("OrderId", "OrderId")
BR.AddRelatedValue("Customers", "CustomerID", "CustomerID", "CustomerName", "xCustomerName", 3)
BR.AddRelatedValue("Shippers", "ShipperId", "ShipVia", "CompanyName", "xCompanyName", 2)
BR.AddGridRelatedValue("Products", "ProductID", "ProductID", "ProductName", "ProductName", 2)
BR.KeyLeaveField(oOrders, "OrderId", 5)
BR.RequiredFields("OrderId+OrderDate+CustomerId")
BR.PopulateForm(Me, oOrders, AxDataGrid1, oOrderDetails) 'Must be your last declaration
after this few lines you will get full automated controling on your form without any additional code to write , it is incredible !
|