p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Access VBA (http://p2p.wrox.com/forumdisplay.php?f=80)
-   -   passing a value to a field in a unbounded form (http://p2p.wrox.com/showthread.php?t=32966)

chacquard August 29th, 2005 07:44 PM

passing a value to a field in a unbounded form

I have a continuous form (bounded to a query that is a result of several queries) and when I click on a control button, I would like to have the value of the EventID field passed to the field (parmEvent) of the unbounded form.

How can I do that ?

Thank you


mmcdonal August 30th, 2005 07:38 AM

Dim inEventID As Integer
Dim stLinkCriteria As String

inEventID = Me.EventID

stLinkCriteria = "[EventID] = " & inEventID

This assumes that EventID is a number, and that you are passing the number to itself as EventID in the form or report you are opening with this button. Use stLinkCriteria in the WHERE section of the DoCmd.Open... command.



chacquard September 5th, 2005 11:03 AM


I did try to use the stLinkCriteria in the "where" section of the docmd.openform... but I get a message because my form is not linked to a query or a table. The "destination" form is some sort of a menu form. I have to select an event in a combobox and click on a control button to print a report, open a form, ...

Now, what I need to do is from a different form, by selecting an event, I want to end up in this "menu" form with the event selected in the combo box.

Let me know if I am not too clear... :)


mmcdonal September 7th, 2005 07:25 AM

What is the recordsource for the form? Can you be more specific about the controls on the menu form?
Why don't you duplicate the controls from the menu form on your first form? What options does the user have on the menu form that you can't provide on the first form?


All times are GMT -4. The time now is 08:31 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.