General discussion

Locked

ACCESS MACRO2000: SYNCRONIZING 2 FORMS

By ruturaj ·
How do I syncronize two forms so that when one opens it opens the other to show the relevent records according to the key fields between them:
I used:
[Customer ID]= Forms![PetsForm]![Customer ID]in the where condition of the macro, OpenForm Customer and I run it
It asks me for the parameter value?

This conversation is currently closed to new comments.

6 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

ACCESS MACRO2000: SYNCRONIZING 2 FORMS

by cryingdragon In reply to ACCESS MACRO2000: SYNCRON ...

I'm not sure if you can link the forms,
however, the PetsForm![Customer ID]
should be placed into a table. Link the
[Customer ID] in Form1 to the Customer
ID column in the PetsForm Table.

Hope this helps.

Mike

Collapse -

ACCESS MACRO2000: SYNCRONIZING 2 FORMS

by ruturaj In reply to ACCESS MACRO2000: SYNCRON ...
Collapse -

ACCESS MACRO2000: SYNCRONIZING 2 FORMS

by dmiles In reply to ACCESS MACRO2000: SYNCRON ...

1)Open the NORTHWIND.MDB database
2)Click Forms under Objects,and then click new.In the New Form dialog bopx,select Design View from the upper list and Products from the Choose The Table Or Query Where TheObjects's Data Comes From drop-down list.Save the form as frmComboTest
3)Right-click the form, and choose Properties from the shortcut menu.Set the form's Default View property to Single Form
4)Add an unbound combo box by using the Control Wizard.(To use the Control Wizard,make sure that the Control Wizard's button is pressed in on the toolbox before you create the combo box)
a. Click the Find A Record On My Form Based On The Value I Selected In My Combo Box button and then click next.
b.Include the ProductID and ProductName fields,and then click next
c.Click Finish
When you open frmComboTest and select a product name from the cboLookup combo box,the filter is set to that value

Collapse -

ACCESS MACRO2000: SYNCRONIZING 2 FORMS

by ruturaj In reply to ACCESS MACRO2000: SYNCRON ...
Collapse -

ACCESS MACRO2000: SYNCRONIZING 2 FORMS

by mcthaker In reply to ACCESS MACRO2000: SYNCRON ...

The easiest way would be to have the second form inserted as a sub-form in the first and linking the master/child fields.
Way1:
The other way would be to have a "ON OPEN" event/macro which filters the records based on a field in the first form.Private Sub Form_Open(Cancel As Integer)
DoCmd.ApplyFilter , wherecondition
End Sub

NB: You may also want to put in additional code to check if the first form is actually open in this case.

Way2:
Use a button on the first form to open thesecond form:
docmd.OpenForm formname,,,wherecondition
(wherecondition would be eg:
1)for text fields:
"[field] = '" & form![fieldname] & "'"

2)for numeric fields:
"[field] = " & form![fieldname]

Collapse -

ACCESS MACRO2000: SYNCRONIZING 2 FORMS

by ruturaj In reply to ACCESS MACRO2000: SYNCRON ...
Back to Software Forum
6 total posts (Page 1 of 1)  

Related Discussions

Related Forums