General discussion

Locked

Access97 - Linking field(s) in multiple

By radicalrat2 ·
I am working on a set of data entry forms for multiple tables. I've choosen to create aswitchboard so that user can update selected table. All is great except that I can't link field(s) from one form to another form. With test trial,it seems thatI can't have the field link from one form to
another by using "=field.table" which means once I data entered a field in
form1, it will not automatically appears in form2. I would like to know if
there is another way besides using the subform (parent/child link). If
anyone has comments please, I would love hear from you. thank you.

This conversation is currently closed to new comments.

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

All Comments

Collapse -

Access97 - Linking field(s) in multiple

by netgod In reply to Access97 - Linking field( ...

There are a few ways to handle this. But since you say "I can't link field(s)", meaning you may have more than 1 field to link, I suggest using Form2 Public variables (property). You can have as many Public properties as you need. And it's SIMPLE toimplement! The only gotcha is that "form2" MUST BE LOADED, prior to passing the data.

Here's an example:

Form2 Code Module
-----------------
Option Explicit

Public PassData1 as string
Public PassData2 as string

Sub Form_Activate()
MyForm2Control1.Text = PassData1
MyForm2Control2.Text = PassData2
End Sub


Form1 Code Module
-----------------
Option Explicit

Sub Form_Load
'// open all the forms (hidden) that you will be passing data to.

DoCmd.OpenForm "form2", windowmode:=acHidden

End Sub

'// use whatever form or control event you want.
Sub Form_Unload
With Form2
.PassData1 = Me.MyForm1Control1.Text
.PassData2 = Me.MyForm1Control2.Text
.Visible = True
End With
End Sub

Hope this helps

Steve

Collapse -

Access97 - Linking field(s) in multiple

by radicalrat2 In reply to Access97 - Linking field( ...

The question was auto-closed by TechRepublic

Collapse -

Access97 - Linking field(s) in multiple

by sujit In reply to Access97 - Linking field( ...

in the field properties of form2 "control source" select the form1's field name that you want to appear by useing EXPRESSION BUILDER. hope this will solve you problem.

Collapse -

Access97 - Linking field(s) in multiple

by radicalrat2 In reply to Access97 - Linking field( ...

The question was auto-closed by TechRepublic

Collapse -

Access97 - Linking field(s) in multiple

by mickfranzen In reply to Access97 - Linking field( ...

hi

If it is just a case of
"once I data entered a field in
form1, it will not automatically appears in form2. "
The quickest way is the field in form1 that is updated run code something like

forms!formname.requery

This will make the data in form 2 update and appear as it should.
also try

forms!formname!fieldname.requery

Sould be faster and a little more precise however either will work.

Collapse -

Access97 - Linking field(s) in multiple

by radicalrat2 In reply to Access97 - Linking field( ...

The question was auto-closed by TechRepublic

Collapse -

Access97 - Linking field(s) in multiple

by radicalrat2 In reply to Access97 - Linking field( ...

This question was auto closed due to inactivity

Back to Web Development Forum
7 total posts (Page 1 of 1)  

Related Discussions

Related Forums