View Full Version : Set Value


Bear
03-02-2000, 06:42 AM
Here's the situation, I've set up one form as a search form where you type in a ID# and click on the search button which starts the macro. The macro is set up to open form, maximize and then set value. The plan is to have it insert the ID# into the appropriate field on the other form if the record sinot found. But when I run it I get an error. I've set it up like this:
Item: [ID]
Expression: [Forms]![Search]![ID]

Mark Fraser
03-15-2001, 03:52 PM
You could use this code under the Command button of the search form.

DoCmd.OpenForm "Form to Open", , , "ID =" & Me.ID

This will open the new form with a Where clause

You can also use "Me" to access variables from the recordset from which the form is based.

Check out DoCmd.OpenForm and Me under visual basic help. F1

Mark