• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 339
  • Last Modified:

Copy value of one field to another on Access Form

I need to copy the value of one field into another from an access form but i keep getting an error about setting focus:

Me!Q2_COMP_BY.Text = UCase(Me!Q1_COMP_BY.Text)
0
shelbyinfotech
Asked:
shelbyinfotech
  • 2
  • 2
1 Solution
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Remove the .Text property.

Me!Q2_COMP_BY= UCase(Me!Q1_COMP_BY)
0
 
danishaniCommented:
Try to use this statement instead;
Me!Q2_COMP_BY = UCase(Me!Q1_COMP_BY)

HTH,
Daniel
0
 
Dale FyeCommented:
Looks like you are coming from the VB community, where the Text property is the default.

In Access you can only use the "Text" property when refering to the control that has the focus.  So, if Q2_Comp_By has the focus, you could use:

me.Q2_Comp_By.text = UCASE(me.Q1_Comp_By.Value)

or you could drop the Value, since it is the default,

me.Q2_Comp_By = UCASE(me.Q1.Comp_By)
0
 
Dale FyeCommented:
That's what I get for providing an explaination!
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
OR ... set Focus to the control first - if you need to reference the Text property:

Me.Q2_COMP_BY.SetFocus
Me.Q2_COMP_BY.Text = UCase(Me.Q1_COMP_BY.Text)

mx
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now