Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

subform adds "blank" new record when marked deletable = no

Post Reply
anorman
Posts: 66
Joined: Wed Apr 04, 2012 11:34 pm

subform adds "blank" new record when marked deletable = no

Unread post by anorman »

Hello,

I have a clients tables, and a contacts table.

On the clients form, I added a subform containing all the contacts associated with that client.

I do NOT want to be able to delete any contacts for database integrity. So, on the subform I set "deleteable" to NO.

However, I do want to be able to add a contact from this subform, so I set BLANK ROWS = 1.

It appears that anytime I do a save on this form, it adds a blank record to the contacts database with the client ID.

Is this some setting I did wrong, or is there a way around this?

This is on Version 2.7

Thanks,
- Andre
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: subform adds "blank" new record when marked deletable =

Unread post by admin »

Andre,

Can you show us the sql used in the subform?

Steven
anorman
Posts: 66
Joined: Wed Apr 04, 2012 11:34 pm

Re: subform adds "blank" new record when marked deletable =

Unread post by anorman »

the SQL statement in the subform is:

Table: contact
Primary Key: cn_id
Foreign Key: cn_cl_id

SELECT * FROM contact WHERE cn_cl_id = '#id#'

Blank rows = 1

If I change DELETEABLE = NO and go into a Client record and save it (say I changed something in the client, not the subform) it will create a new blank record (with the Client ID in the foreign key) in the contact table.

changing DELETEABLE = YES (So the check boxes with the "DELETE" column at the end of the blank row) shows up, the problem does not occur.

Am I doing something wrong, is this a bug, or is this a limitation?
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: subform adds "blank" new record when marked deletable =

Unread post by admin »

Andre,

This might be your answer..

http://forums.nubuilder.cloud/viewtopic.p ... nk+subform

Steven
Post Reply