Forward Record Selector creating new records (1 Viewer)

Fozi

Registered User.
Local time
Today, 19:59
Joined
Feb 28, 2006
Messages
137
Hi all

Currently if a user clicks on the Forward record selector it will create a new record. Parent Form has two subforms, some controls have default values. Is it the Default values that are enabling this or something else?

More importantly, how would one go about preventing it? Thought about disabling 'Allow Additions' and adding a conditon button or some sort but would perfer not to add this if there is a more asthetically (sp?) pleasing solution

Thanks
Frank
 

Banana

split with a cherry atop.
Local time
Today, 11:59
Joined
Sep 1, 2005
Messages
6,318
Is the navigation buttons builtin or custom DYI buttons?
 

Fozi

Registered User.
Local time
Today, 19:59
Joined
Feb 28, 2006
Messages
137
Is the navigation buttons builtin or custom DYI buttons?

Hi Banana

Affects both methods.

Thanks
Frank
 

Banana

split with a cherry atop.
Local time
Today, 11:59
Joined
Sep 1, 2005
Messages
6,318
Do you have anything in the code behind the form that would create a new record? It's possible the code is getting triggered at wrong time, because the normal behavior is to not add new record until the form is dirtied. Default values does not affect the dirty state.
 

Rabbie

Super Moderator
Local time
Today, 19:59
Joined
Jul 10, 2007
Messages
5,906
I have checked in some of my DBs. In forms that are used to display and add records it creates a new record if I use the navigation buttons to go o the end of the recordset. However if I then scroll backwards before adding any data to the new record it disappears without trace.
 

missinglinq

AWF VIP
Local time
Today, 14:59
Joined
Jun 20, 2003
Messages
6,423
A Default Value doesn't even Dirty the form, unless you enter some other data. The only way to prevent it from appearing to create a new record is the method you've already talked about, setting Me.AllowAdditions to No and having an "Add record" button.
 

evanscamman

Registered User.
Local time
Today, 11:59
Joined
Feb 25, 2007
Messages
274
Check your code. In Form.Current you probably have something that is causing the record to be dirty. If you can't find it, add a watch for Forms!myForm.Dirty and set it break when value changes. This will show you the line that is causing it.

Evan
 

Fozi

Registered User.
Local time
Today, 19:59
Joined
Feb 28, 2006
Messages
137
Cheers everyone

All very helpful. I'll check the form and get back to you.

Thanks
Frank
 

Fozi

Registered User.
Local time
Today, 19:59
Joined
Feb 28, 2006
Messages
137
Thanks to all of you. I did indeed have some code in my OnCurrent property that was the cause.

Now duly removed.

Thanks again Frank
 

Users who are viewing this thread

Top Bottom