Hi,
Thanks for your reply. The form I am on, and the form which will be opened to choose which CR_DEFECT's go with each promotion are both bound.
I have used the following code:
Private Sub btn_open_promotion_frm_Click()
DoCmd****nCommand acCmdSaveRecord
DoCmd.OpenForm "PROMOTION_ITEMS" '(the form I want to open, and carry the autonumber value to)
Dim txtCR_DEFECT As String
Dim TEXT_PROMOTION_ID As String
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("CR_DEFECT") (This is a table?)
rs.Index = "CR_DEFECT_REF_NUM" (Index field in the CR_DEFECT table)
rs.Seek "=", txtCR_DEFECT
TEXT_PROMOTION_ID = rs!PROMOTION_ID
End Sub
This code opens up the promotions items table and I am getting the error message item not found in this collection. when i debug, the following code is highlighted :
TEXT_PROMOTION_ID = rs!PROMOTION_ID
Also the autonumber doesn't seem to have been populated. I had two put the two string variables in as access kept saying they were undefined.
Thanks for your help once again.
Parma