Preguntas más frecuentes

Preguntas frecuentes de autoayuda.

Eche un vistazo rápido a las preguntas (y respuestas) comunes en la lista predeterminada. Si no puede encontrar lo que está buscando, comience seleccionando su versión Ability Office y luego redúzcalo ingresando el texto de búsqueda y/o la categoría.

Artículo de la base de conocimiento 96

How to use macro buttons to link Database forms

How to link two Database forms together using macros and macro buttons.

Typical scenario is that you're browsing in database form view and you want a button to display a record from another (usually related) table:

  1. Switch the Form to Design Mode using View/Design

  2. Select Insert/Macro Button and draw out the new button

  3. Right-click and select Properties

  4. Give the button some meaningful display text

  5. Select the Macros tab

  6. Select the "click" event (you don't have to but this is the normal way to use a button)

  7. Select New Macro and give it a name

  8. Save the form

  9. In Database Manager, right-click over the new macro and select Edit

  10. Enter the following code (adjust to your own form / field names)

Sub OpenRelatedForm () 
  id = ActiveDataObject.Fields("LinkFld1").Value
  Set MyRelatedForm = DBForms.Open ("NameOfForm")
  MyRelatedForm.Filter = "LinkFld2 = " & id
End Sub

Where:

An example of a very simple system of two linked tables can be downloaded here. Open the form EmailForm, browse and use the button "Get Customer". Code is in the GetCustomer macro.