Form opens to new record, not specific record

Reese

Registered User.
Local time
Today, 15:35
Joined
Jan 13, 2013
Messages
387
I have a form that opens from a different form based on the primary key within the original form. Unfortunately it seems to be opening a new record every time I open the form--not only from the original form but also straight from the sidebar.

The command button that opens the second form from the first uses the following VBA:

DoCmd.OpenForm "ZooMobile Incomplete Booking-Return Client", , , "[Event_ID] = " & Me.EventID

This exact coding worded perfectly in a similar set of forms that I had created; the only difference is a change in the form name & primary key field.

Add onto this, I think that the code DOES work, but then it immediately opens another new record. When I open the second form from the command button, then change to Design View, the form's Filter property is set to [Event_ID]=X (where X is the proper key from the first form) and Filter On Load is set to Yes. The X in the Filter changes accordingly when it changes in the first form. Also, every time I open the form a new record is added to the underlying table.

I've tried setting "Allow Additions" in the second form to No, but then when I open the form nothing appears. Literally; the entire form is blank, no labels, textboxes, combos, buttons or anything. When going to Design View it's still all there.

I've also checked the On_Load, On_Current & Form_Current events and found nothing. I even deleted them and the problem still occurred.

Any suggestions?
 
Does the form add a new ID number to the table or just open the form to add a new record?
If the form is adding a new ID number then something in the form is dirtying (creating) data.

If it is opening to add a new record the check the data tab for Data Entry Yes and change it to NO.

Dale
 
Could you use the send object function? This could allow you to push the objects in one form through to another
 
If it is opening to add a new record the check the data tab for Data Entry Yes and change it to NO.

Success! Yes, it was giving the new entries ID numbers. Could you explain a little bit about the possible cause of the problem & how the Data Entry impacted it? I'd like to understand how this could have happened & how to avoid it.

Could you use the send object function? This could allow you to push the objects in one form through to another

Could you explain this a little more? The first solution worked great but I'm not really sure what you mean by send object. I'd like to know more so that I can use it (or make sure to avoid it) in the future.

Thanks!
 
Something in the form is making a new record when it is opened.

Can you upload the database?

Dale
 

Users who are viewing this thread

Back
Top Bottom