Hi,
First post, so hope it's in the right place and done appropriately!
Working with an Access Form (in 2010 but would like to be backwards compatible to 2003), I'm trying to create a button that, if clicked, would copy all the information entered in a set of text boxes, into another set of text boxes on the same form.
In more detail: I have a form to collect information about 2 types of people associated with a common object, (i.e. Collectors and Donors). Sometimes this is the same person, but I still need to record this persons information as both Collector and Donor.
I've been trying to find a way to code a button that would, where necessary, allow a simple click to copy all the information in the Collector fields to the Donor fields but I'm completely new to any sort of programming!
I can make it work using a clumsy code (below, created in 2010), but this doesn't work where there are blank fields (which are unavoidable) and it doesn't seem to work at all in Access 2003 (In fact Access 2003 really doesn't like it and falls over when I try to edit the VB code for this).
Code:
Private Sub CollectorIsDonor_Click()
Me.CollectorTitle.SetFocus
Me.CollectorTitle.SelStart = 0
Me.CollectorTitle.SelLength = Len(Me.CollectorTitle.Value)
DoCmd.RunCommand acCmdCopy
DoCmd.GoToControl "DonorTitle"
Me.DonorTitle.SetFocus
DoCmd.RunCommand acCmdPaste
(Repeated for each applicable field in the form)
End Sub
I've definitely bitten off more than I can chew, but how else will I learn?
Thanks for any help offered.