Insert details to new form.

Numpty

on t'internet
Local time
Today, 08:00
Joined
Apr 11, 2003
Messages
60
I have a button on a form [Delegateform] which when click opens another form [AccessFund]. They are linked via the DelegateID. This works fine if there is an existing record for that DelegateID for the AccessFund but if not it will open a blank form.
What I would like to be able to do is transfer some details from the DelegateForm into the new form to aid data input e.g Surname & FisrtName.
I can't seem to work out the code needed in the on click event to get this to work.

Hope someone can help and thanks in advance.
 
Try adding the following to the On Click event of the button:

[Forms]![AccessFund]![SurName] = Me.SurName
[Forms]![AccessFund]![FirstName] = Me.FirstName

Of course this will over ride anything that is currently in the fields on the form, so you might want to try the following instead:

If IsNull([Forms]![AccessFund]![SurName]) then
[Forms]![AccessFund]![SurName] = Me.SurName
Else
End if

If IsNull([Forms]![AccessFund]![SurName]) then
[Forms]![AccessFund]![FirstName] = Me.FirstName
Else
End if

HTH
 
Thanks for your help there guys!

Just needed to use an If statement for the DelegateID because the rest of the fields update automatically then.

Cheers!!
 

Users who are viewing this thread

Back
Top Bottom