Hi, I have been playing around with various forms and have asked some previous questions on this topic, but thought it best to start a new thread since my forms structes have changed if anyone can help I am almost there.
I have two forms
Form 1 =Detail
Form 2 =DetailUpdate (the fields in this form are bound to a table OrderDetailUpda te)
Detail displays information based on a combo box look up in a datasheet view from a table OrderDetail, the look up value is OrderNumber. I have a command button that opens the form in DetailUpdate , also a datasheet view and I want the data from Detail that is displayed to carry over to DetailUpdate. Form 1 has fields OrderNumber and PartNumber and I put code in the command button to put those fields into Form 2, this works but it only populates the first row and most times Form 1 has multiple lines on it. I was thinking if there was a way to instruct the code to append the data of all records from Form 1 to 2.
This is what I have right now:
////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////
This updates the first line, but that is all. Might be a simple answer, but I sure can't figure it out. Any help would be appreciated.
Thanks Mark.
I have two forms
Form 1 =Detail
Form 2 =DetailUpdate (the fields in this form are bound to a table OrderDetailUpda te)
Detail displays information based on a combo box look up in a datasheet view from a table OrderDetail, the look up value is OrderNumber. I have a command button that opens the form in DetailUpdate , also a datasheet view and I want the data from Detail that is displayed to carry over to DetailUpdate. Form 1 has fields OrderNumber and PartNumber and I put code in the command button to put those fields into Form 2, this works but it only populates the first row and most times Form 1 has multiple lines on it. I was thinking if there was a way to instruct the code to append the data of all records from Form 1 to 2.
This is what I have right now:
////////////////////////////////////////////////////////////////////////////////////////
Code:
Private Sub OpenOrderUpdateForm_Click()
On Error GoTo Err_OpenOrderUpdateForm_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmDetailUpdate"
DoCmd.OpenForm stDocName
Forms!frmDetailUpdate!OrderNumber = Me.OrderNumber
Forms!frmDetailUpdate!PartNumber = Me.PartNumber
Exit_OpenOrderUpdateForm_Click:
Exit Sub
Err_OpenOrderUpdateForm_Click:
MsgBox Err.Description
Resume Exit_OpenOrderUpdateForm_Click
End Sub
This updates the first line, but that is all. Might be a simple answer, but I sure can't figure it out. Any help would be appreciated.
Thanks Mark.
Comment