HI All,
I have been successful in copying the data from my existing main form and create a new record but when I am trying to do the same for my sub form, it doesn't work?
I am using D-Lookup to copy and create a new record on click
here's the code that worked for my main form
Private Sub btnA_Click()
Dim ID As Long
ID = TransactionID
DoCmd.GoToRecord , , acNewRec
[Date Expected] = DLookup("[Date Expected]", "Transactions", "TransactionID=" & ID)
[PO Date] = DLookup("[PO Date]", "Transactions", "TransactionID=" & ID)
[Requisitioner] = DLookup("[Requisitioner]", "Transactions", "TransactionID=" & ID)
[SupplierID] = DLookup("SupplierID", "Transactions", "TransactionID=" & ID)
[Destination ID] = DLookup("[Destination ID]", "Transactions", "TransactionID=" & ID)
End Sub
Above code works for my main form and creates a new record with all my details but my sub-form stays blank?
What should I do please guide me
Thank You
I have been successful in copying the data from my existing main form and create a new record but when I am trying to do the same for my sub form, it doesn't work?
I am using D-Lookup to copy and create a new record on click
here's the code that worked for my main form
Private Sub btnA_Click()
Dim ID As Long
ID = TransactionID
DoCmd.GoToRecord , , acNewRec
[Date Expected] = DLookup("[Date Expected]", "Transactions", "TransactionID=" & ID)
[PO Date] = DLookup("[PO Date]", "Transactions", "TransactionID=" & ID)
[Requisitioner] = DLookup("[Requisitioner]", "Transactions", "TransactionID=" & ID)
[SupplierID] = DLookup("SupplierID", "Transactions", "TransactionID=" & ID)
[Destination ID] = DLookup("[Destination ID]", "Transactions", "TransactionID=" & ID)
End Sub
Above code works for my main form and creates a new record with all my details but my sub-form stays blank?
What should I do please guide me
Thank You