Form SubForm Help

samjh

Registered User.
Local time
Today, 23:10
Joined
Jan 10, 2013
Messages
64
Hi I'm new here, and am building a database with a colleague, and am needing a little help and guidance on the way. Hope you can help me.

I have a form in my database, which shows clients (this data is already in the database) it currently has a sub form, which is a data table which shows commitments for that client. I don't want the user to edit anything in this form, however from this form I want them to be able to add new commitments, I have a form for this, or edit current commitments, which are held in a table.

my thinking was that I would have a button on the client from that would say new commitment, and this would open a blank commitment form which would already have the client ID filled in and the user will enter the rest of the information, I would then want them to be able to navigate back to the client form, which will then show this new commitment in the subform that is there.

As well as this, I would like them to be able to edit one of the commitments that is there, so by following a similar process to above.

Any help would be greatly appreciated.
Thanks
 
The same funtionality can be achieved very simply by giving the popup form the same recordset as the main form. It will be at the same record as the main form's current record.

In the popup form's OnLoad Event Procedure:

Set Me.Recordset = Forms!mainform.Recordset
 
The same funtionality can be achieved very simply by giving the popup form the same recordset as the main form. It will be at the same record as the main form's current record.

In the popup form's OnLoad Event Procedure:

Set Me.Recordset = Forms!mainform.Recordset

OK that could pass the ClientID to the update form but not the address info from the subform.
 
Hi, sorry for the delay in replying to this.

I have managed to have my sub form either open to create a new record, which is fine, but it isn't transfering the clientID to the form. also if I double click on one of the records within the subform to edit it, it opens on the first record which isn't nessesarily the record for that client.

I tried to copy the code from within the test databse, and changed a few bits to suit my forms and records, but I think I've just got totally confused, especialy as I had code in there in the first place to do certain things.

I really want to learn how to do this, so is there any sites you could recomend that would show me how to do what I want to do?

Thanks again.
 
Hi again,

I've managed to get everything working for now.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom