Copy value from one subform and put it into another continuous subform.

DanJames

Registered User.
Local time
Today, 07:41
Joined
Sep 3, 2009
Messages
78
Hi

Here is code I am using to copy a value from a subform to a continuous subform.

Code:
Private Sub Command38_Click()
Dim MyForm As String
MyForm = Form!SUBCleanerJobSearch![Cleaner-ID].Value

//Somewhere here it would be good to go to the next record with no cleanerid value thus add a new record if the first hasn't been added//

Form!SUBJobCleanerLink!CleanerID.Value = MyForm
End Sub

The problem I am having is that when I click the button, it adds the cleanerid to the first record in the continuous form, and when I click it again it just changes the first row/record cleanerid value, rather than creating a new record below?

Thanks
 
Figured it out:

Private Sub Command39_Click()
Dim MyForm As String
MyForm = Form!SUBCleanerJobSearch![Cleaner-ID].Value

Me!SUBJobCleanerLink.SetFocus

DoCmd.GoToRecord , , acNewRec

Form!SUBJobCleanerLink!CleanerID.Value = MyForm
End Sub

Thanks anyway
 

Users who are viewing this thread

Back
Top Bottom