Passing a variable

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Ok this is my first post, but I have a form where I select an event from a
drop-down list, then I go to a new form when I click the go button which will
load that event with all the attendees. The names are listed in continuous
form, and I have two buttons at the bottom, an Add and Edit. The Edit works
fine which loads the same Event at the top with the correct person chosen
from the list. But when I go to the Add one the EventID doesn't get passed
through so it will not let me add a new record. Will I have to add their name
first to the bottom of the continuous forms section then edit the rest of
the record through the edit button? or is there a way I can add a brand new
record using the add button?
 
Presumably you have an EventID in your continuous form, and you want to open
Form1 in add mode and assign the value of EventID.

The code for the Click event procedure of your command button would look
like this:
DoCmd.OpenForm "Form1",,,,acFormAdd
Forms!Form1!EventID = Me.EventID

That assumes:
a) Form1 is not already open;
b) It does not open modally.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top