Passing values between forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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
 
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
 
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
 
Back
Top