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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy text box contents 1

Status
Not open for further replies.

markswan20

Technical User
Jun 17, 2005
58
GB
Good Afternoon everyone.

I have a small but basic question.

Is it possible within access to have a command button that once pressed can copy the contents of 2 text boxes into 2 other text boxs?

Kind Regards
Mark
 
Yes. You can use something like:
Code:
Text1.Value = Text2.Value etc...
Hope this helps

HarleyQuinn
---------------------------------
Help us to help you,
read FAQ222-2244 before posting.
 
Cheers guys.

I have it working is there a way of adding a confirmation box pop up before the command button will change the information?

Cheers Mark
 
msgbox?

HarleyQuinn
---------------------------------
Help us to help you,
read FAQ222-2244 before posting.
 
My apologies msgbox yes!

I have created a second form that pops up to confirm data change.

I have used the code on my original page and the form updates but what code will i need to tell it to update the original page?

Kind Regards
Mark
 
What have you got so far?

HarleyQuinn
---------------------------------
Help us to help you,
read FAQ222-2244 before posting.
 
I have used the above code within a command button on the page I want updated now I want the original button to open a confirmation page for safety reasons.

I have a second page called Confirmation, within this page I have 2 command buttons 1 yes 1 no.

(No) closes the form and takes you back to the original
(Yes) I want to update the original page called C_Details.

This is my original code for my original page.

Private Sub Update_Details_Click()
Text176.Value = Text191.Value
Text179.Value = Text194.Value
Text181.Value = Text196.Value
Text183.Value = Text198.Value
Text185.Value = Text200.Value
Text187.Value = Text202.Value
Text189.Value = Text204.Value
Installation_Date = (Date)
Enquiry_Date = (Time)

End Sub

Cheers Mark
 
How about actually using a msgbox?

Something like:
Code:
Private Sub Update_Details_Click()

Dim a As String

a = MsgBox("Do you want to update details?", vbYesNo, "Confirm Update")

If a = vbYes Then

Text176.Value = Text191.Value
Text179.Value = Text194.Value
Text181.Value = Text196.Value
Text183.Value = Text198.Value
Text185.Value = Text200.Value
Text187.Value = Text202.Value
Text189.Value = Text204.Value
Installation_Date = (Date)
Enquiry_Date = (Time)

Else

'return to original values

End If

End Sub
That saves you having to code the extra form.

Hope this helps

HarleyQuinn
---------------------------------
Help us to help you,
read FAQ222-2244 before posting.
 
Thats made my life so much easier.

Thank you HarleyQuinn

Kind Regards
Mark
 
You're welcome, glad I could help [smile]

HarleyQuinn
---------------------------------
Help us to help you,
read FAQ222-2244 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top