Grab text from multiple forms

Grab text from multiple forms

Page 1 of 1

5 Replies - 1692 Views - Last Post: 19 May 2009 - 02:34 AM Rate Topic: -----

#1 fusion_prog_guy   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 17-May 09

Grab text from multiple forms

Posted 17 May 2009 - 11:01 PM

Hi, I'm trying to add a function to an existing project done by someone else. It has multiple forms (tabs) and fields on those forms. One form is called frmLeaseMarketLevy and one is frmLeaseBaseRent both of these are on the form frmLease.

What I'd like to do within the frmLeaseMarketLevy is do a simple calculation. I'd like to multiply the field BRAmount from the frmLeaseBaseRent with MLCurrentRentPer on frmLeaseMarketLevy. I tried multiple ways of referencing the text box, but the program freezes when I run it. I've commented out stuff so I can see where it hangs. It seems to get stuck on the line where it says MsgBox "Q1B" ....

This is my attempt at the new function.

 Public Sub CalcMarketLevyAmount()
	
	' Call function to calc MLAmount

'		MsgBox "CalcMarketLevyAmount MA value = " & Me.[MLAmount].Value
'		MsgBox "Q1A" & Me.MLCurrentRentPer.Value
		MsgBox "Q1B" & Me.frmleaseBaseRent.[BRAmount].Value

'		If Me.frmleaseBaseRent.Form![BRAmount].Value > 0 Then
'			Me.[MLAmount] = Me.[MLCurrentRentPer].Value * Me.frmleaseBaseRent.Form![BRAmount].Value
'		End If

ExitHere:
	Exit Sub
ErrorHere:
	Call LogError(Application.CurrentObjectName, "CalcMarketLevyAmount", Err.Number, Err.Description, False)
	Resume ExitHere
End Sub 


Any help appreciated.

Is This A Good Question/Topic? 0
  • +

Replies To: Grab text from multiple forms

#2 fusion_prog_guy   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 17-May 09

Re: Grab text from multiple forms

Posted 17 May 2009 - 11:11 PM

Here are some screen shots so you can see what I'm trying to do. Attached ImageAttached Image
Was This Post Helpful? 0
  • +
  • -

#3 thava   User is offline

  • D.I.C Lover
  • member icon

Reputation: 180
  • View blog
  • Posts: 1,607
  • Joined: 17-April 07

Re: Grab text from multiple forms

Posted 18 May 2009 - 02:56 AM

is it a VBA ?????

This post has been edited by thava: 18 May 2009 - 02:57 AM

Was This Post Helpful? 0
  • +
  • -

#4 firebolt   User is offline

  • D.I.C Lover
  • member icon

Reputation: 93
  • View blog
  • Posts: 5,561
  • Joined: 20-February 09

Re: Grab text from multiple forms

Posted 18 May 2009 - 03:17 AM

Is this VB6 or VB.NET?
Was This Post Helpful? 0
  • +
  • -

#5 fusion_prog_guy   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 17-May 09

Re: Grab text from multiple forms

Posted 19 May 2009 - 02:21 AM

View Postfirebolt, on 18 May, 2009 - 02:17 AM, said:

Is this VB6 or VB.NET?


Hi, Its not VB.NET. I think its VBA. Its withn Access that I am modifying the code, so assume that is VBA?
Was This Post Helpful? 0
  • +
  • -

#6 firebolt   User is offline

  • D.I.C Lover
  • member icon

Reputation: 93
  • View blog
  • Posts: 5,561
  • Joined: 20-February 09

Re: Grab text from multiple forms

Posted 19 May 2009 - 02:34 AM

What do you mean "I think its VBA"? So your not sure what program your using?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1