Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

set the same valuein other field

Status
Not open for further replies.

amna77

Programmer
May 27, 2003
69
GB
hi on my form I have text field project, right, so now what i want to do is, when ever soem one enters project in the txtproject, then i want the same value in the txtpartnumber. i try to put the codes on exit event of txtproject, but its giving me error.
any idea,
thanks in advance.
 
Private Sub Project_BeforeUpdate(Cancel As Integer)
Me.txtPartNum = Me.txtProjName
End Sub

I have those above codes, but error comes up that field cannot be updated. why is that? is it becuase my form is based on query thats why?
 
What is the ControlSource of txtPartNum ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
controlSource of txtpartnum is txtpartnum. actually my form is based of query and that query has two tables, one is project table and other one is tblparts, so that txtpartnumber is from tblparts. is there a way that i can attach a from for you so you can review.
thanks
 
How are ya amna77 . . . . .
amna77 said:
[blue]on my form I have text field [purple]project[/purple] . . . . when ever soem one enters project in the [purple]txtproject[/purple][/blue]
Then is your code you have:
Code:
[blue]Private Sub [purple][b]Project[/b][/purple]_BeforeUpdate(Cancel As Integer)
Me.txtPartNum = Me.[purple][b]txtProjName[/b][/purple]
End Sub[/blue]
Project or txtProject . . . . who's who?

Then in your code, you don't even use txtProject, you use [purple]txtProjName[/purple] which is not mentioned in your post origination.

Its hard to pin things down when controls are implied in this way . . . . . .

Is [blue]Project[/blue] a seperate control from [blue]txtProject?[/blue]

[blue]txtProjName[/blue] is updated when?

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top