Welcome to the nuBuilder Forums!

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

Pulling master-form data into a browse subform

Post Reply
jmusther
Posts: 10
Joined: Thu Jan 10, 2013 4:51 am

Pulling master-form data into a browse subform

Unread post by jmusther »

I have a form which displays client information. I have added a browse subform which shows data from a table holding information about important dates associated with that client.

My two tables are therefore:
clients (for which the primary key is id)
dates (for which the primary key is id, and which contains the foreign key clientid)

My browse subform uses the SQL:
SELECT * FROM dates WHERE clientid = #id#

This works well.

When it comes to creating a new record in the subform however, I need to automatically fill in the client id for the client currently being viewed in the master form. This way, any new record created from this browse subform will be associated with the correct client.
The only way I can find to do this is the have the default filter for the browse subform set to #id#, and then use the the following to automatically fill in the 'clientid' field once the edit form is opened:
SELECT #browse_filter#

The above does work, but it seems a little messy, is there a cleaner way to do this?

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

Re: Pulling master-form data into a browse subform

Unread post by admin »

jmusther,

Using #browse_filter# is the way to do it.

Steven
Post Reply