Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing through values between forms

Status
Not open for further replies.

jurgen

Programmer
Feb 8, 2001
209
BE
Hi,

Another one ...

How can I pass through values between forms, the problem i have is the following.

I have a table that stores quotes that i have to save in other tables (no relation possible), i created a form with a listbox that lists only the active quotes, i select the quote i want and then i want to fill in the selected quote on to another form. ex
form1 - quote select, form 3 - quote select, etc

The quote form has to be used in different forms and I can't use a combo box.

Can someone help me with this one ... I hope that I explained it a little bit correct
Regards


Jurgen
 
1. You could try passing the value in the
Code:
OpenArgs
argument of
Code:
DoCmd.OpenForm
,
2. You could reference a control on an already open form directly, using
Code:
Forms(myForm).Controls(targetControlName) = whatever
3. You could set a filter on the target form either during a
Code:
DoCmd.OpenForm
, or directly using
Code:
Forms(myForm).Filter = whatever

4. Alternatively, if you really need multiple instances of the same form with different data open at the same time, try
Code:
Sub sbNuMyForm()

On Error Resume Next
Dim frm As Form_myForm
Set frm = New Form_myForm
(Load/filter the new form instance as desired)
Code:
frm.Visible = True

While frm.Visible
     DoEvents
Wend

Set frm = Nothing

End Sub
 
I have FormA that is open. A user wants to add a new person using FormA. The OnClick function of the Add Button opens a dialog box used for FormB. The dialog box asks the last name of the employee and then queries the Person Database in Oracle and FormB displays the last name matches.

Now I have a button next to each name which will pass back the employee information (phone, cube, ID#) to FormA. But all my data is null. How do I use OpenArgs when the form to be opened (FormA) is already open or how do I pass the data (I really only need the PersonID) to FormA???HELP!

If you followed this far - Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top