Passing values between forms

R

Ronnie

I have 2 forms one called fmCompanies and another fmpersonal. On the
fmcompanies form there is a field called amount. When clicking on a button
in the fmcompanies form, I want to pass the value in the amount field, to a
field called CarriedAmount in the fmpersonal form.

I am new to VB so still learning. I believe you have to use the property
get procedure. I have had a few attempts but I am having no luck. Could
someone please help and provide some sample code so I can progress.

Thanks

Ronnie
 
P

PC Datasheet

fmpersonal must be open at the same time fmCompanies is open. fmpersonal can be
not visible. Put the following code in the click event of the button:

Forms!fmpersonal!CarriedAmount = Me!Amount
 
R

Ronnie

I have opened up the 2 forms and the in the click event I have entered
Forms!fmpersonal!CarriedAmount = Me!Amount

I am now getting an error message "Method item of object !forms! failed"

I have checked the names of the forms and they are all correct. I have also
check the names of the objects on the forms and these are also correct.

Help
 
P

PC Datasheet

Did you use an exclamation point after "Forms" and after "frmpersonal"?

Is "CarriedAmount" the name of the textbox? Select the textbox, open properties,
go to the Other tab and look at the Name property.

Steve
PC Datasheet
 
R

Ronnie

I think all the previous coding to pass the value had somehow corrupted some
part of the code behind the form. Recreated forms again and it worked.

Thanks Ronnie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top